Avoid race conditions with autopause
This commit is contained in:
@@ -331,6 +331,7 @@ class AutopauseTimer:
|
|||||||
seconds -= 1
|
seconds -= 1
|
||||||
if not self.stop_event.is_set():
|
if not self.stop_event.is_set():
|
||||||
self.stop_event.set()
|
self.stop_event.set()
|
||||||
|
if not paused:
|
||||||
pause_handler(True)
|
pause_handler(True)
|
||||||
|
|
||||||
|
|
||||||
@@ -528,7 +529,7 @@ def process_and_write_results(img_or_path, write_to, notifications, last_result,
|
|||||||
with Path(write_to).open('a', encoding='utf-8') as f:
|
with Path(write_to).open('a', encoding='utf-8') as f:
|
||||||
f.write(text + '\n')
|
f.write(text + '\n')
|
||||||
|
|
||||||
if auto_pause_handler:
|
if auto_pause_handler and not paused:
|
||||||
auto_pause_handler.start()
|
auto_pause_handler.start()
|
||||||
else:
|
else:
|
||||||
logger.opt(ansi=True).info(f'<{engine_color}>{engine_instance.readable_name}</{engine_color}> reported an error after {t1 - t0:0.03f}s: {text}')
|
logger.opt(ansi=True).info(f'<{engine_color}>{engine_instance.readable_name}</{engine_color}> reported an error after {t1 - t0:0.03f}s: {text}')
|
||||||
|
|||||||
Reference in New Issue
Block a user