Wait 60 seconds or until stop_thread is set

pull/296/head
dgtlmoon 2021-12-09 23:28:17 +01:00
rodzic 7f8c0fb2fa
commit 5bbd82be79
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -392,7 +392,11 @@ class ChangeDetectionStore:
self.sync_to_json()
# Once per minute is enough, more and it can cause high CPU usage
time.sleep(60)
# better here is to use something like self.app.config.exit.wait(1), but we cant get to 'app' from here
for i in range(30):
time.sleep(2)
if self.stop_thread:
break
# Go through the datastore path and remove any snapshots that are not mentioned in the index
# This usually is not used, but can be handy.