Commit 6c11a1da authored by Guillaume Seguin's avatar Guillaume Seguin

Prevent status thread from freezing upon system time change

parent b8f549b6
...@@ -1307,10 +1307,14 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1307,10 +1307,14 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.p.send_now("M27") self.p.send_now("M27")
self.p.send_now("M105") self.p.send_now("M105")
cur_time = time.time() cur_time = time.time()
wait_time = 0
while time.time() < cur_time + self.monitor_interval: while time.time() < cur_time + self.monitor_interval:
if not self.statuscheck: if not self.statuscheck:
break break
time.sleep(0.25) time.sleep(0.25)
wait_time += 0.25
if wait_time > self.monitor_interval:
break
try: try:
while not self.sentlines.empty(): while not self.sentlines.empty():
gc = self.sentlines.get_nowait() gc = self.sentlines.get_nowait()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment