Re #23 - always check value of interval time, not just on start

diff-stream
dgtlmoon 4 years ago
parent 0fa443c3f2
commit 14d88c249e

@ -648,15 +648,16 @@ def ticker_thread_check_time_launch_checks():
running_update_threads.append(new_worker) running_update_threads.append(new_worker)
new_worker.start() new_worker.start()
# Every minute check for new UUIDs to follow up on
minutes = datastore.data['settings']['requests']['minutes_between_check']
while not app.config.exit.is_set(): while not app.config.exit.is_set():
running_uuids = [] running_uuids = []
for t in running_update_threads: for t in running_update_threads:
running_uuids.append(t.current_uuid) running_uuids.append(t.current_uuid)
# Look at the dataset, find a stale watch to process # Look at the dataset, find a stale watch to process
# Every minute check for new UUIDs to follow up on, should be inside the loop incase it changes.
minutes = datastore.data['settings']['requests']['minutes_between_check']
threshold = time.time() - (minutes * 60) threshold = time.time() - (minutes * 60)
for uuid, watch in datastore.data['watching'].items(): for uuid, watch in datastore.data['watching'].items():
if watch['last_checked'] <= threshold: if watch['last_checked'] <= threshold:

Loading…
Cancel
Save