Skip to content

Commit

Permalink
[Bug] Add lock on RPC status watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Feb 10, 2020
1 parent b3f47f2 commit 4b37578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions spmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@

# Close Splashscreen
splash.close()

##-- Launch RPC watchdog
ex.mainWindow.rpc_watchdogThread.start()


try:
##-- Launch RPC watchdog
ex.mainWindow.rpc_watchdogThread.start()
except Exception as e:
print(e)

# Execute App
app.exec_()
try:
Expand Down
5 changes: 3 additions & 2 deletions src/watchdogThreads.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ def run(self):
while not self.shutdown_flag.is_set():
# update status without printing on debug
self.control_tab.updateRPCstatus(self.ctrl_obj, False)
with self.control_tab.lock:
connected = self.control_tab.rpcConnected

if not self.control_tab.rpcConnected:
if not connected:
sleep(self.timer_off)

else:
sleep(self.timer_on)

Expand Down

0 comments on commit 4b37578

Please sign in to comment.