From 780c8dc8afe1cafff1bc1affd01e8088f6b8b857 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 1 Sep 2026 17:45:51 +0200 Subject: [PATCH] Pause Queue - Best to pause it in the watch loop so that it works with very long lists of watches --- changedetectionio/flask_app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 66e85cdf4..e94c39792 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -1269,11 +1269,6 @@ def ticker_thread_check_time_launch_checks(): last_health_check = now - # Check if all checks are paused - if datastore.data['settings']['application'].get('all_paused', False): - app.config.exit.wait(1) - continue - # Get a list of watches by UUID that are currently fetching data running_uuids = worker_pool.get_running_uuids() @@ -1307,6 +1302,11 @@ def ticker_thread_check_time_launch_checks(): logger.debug(f"Queue size limit reached ({current_queue_size}/{MAX_QUEUE_SIZE}), stopping scheduler this iteration.") break + # Check if all checks are paused - this loop could get stuck on very long lists of watches, best to check here. + if datastore.data['settings']['application'].get('all_paused', False): + app.config.exit.wait(1) + break + now = time.time() watch = datastore.data['watching'].get(uuid) if not watch: