From 14d88c249ed3f154c11c86e452523047931eac20 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 29 Mar 2021 15:03:33 +0200 Subject: [PATCH] Re #23 - always check value of interval time, not just on start --- backend/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/__init__.py b/backend/__init__.py index 720838ca..634c549f 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -648,15 +648,16 @@ def ticker_thread_check_time_launch_checks(): running_update_threads.append(new_worker) 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(): running_uuids = [] for t in running_update_threads: running_uuids.append(t.current_uuid) # 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) for uuid, watch in datastore.data['watching'].items(): if watch['last_checked'] <= threshold: