From eaae664dca2f5a137c1e9deb054eefb573a89adc Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 5 Jan 2026 10:08:13 +0100 Subject: [PATCH] Use soft delays instead of blocking time sleeps --- changedetectionio/flask_app.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index c831c71d..af6293b6 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -680,7 +680,7 @@ def notification_runner(): # At the moment only one thread runs (single runner) n_object = notification_q.get(block=False) except queue.Empty: - time.sleep(1) + app.config.exit.wait(1) else: @@ -775,7 +775,7 @@ def ticker_thread_check_time_launch_checks(): # Re #438 - Don't place more watches in the queue to be checked if the queue is already large while update_q.qsize() >= 2000: logger.warning(f"Recheck watches queue size limit reached ({MAX_QUEUE_SIZE}), skipping adding more items") - time.sleep(3) + app.config.exit.wait(10.0) recheck_time_system_seconds = int(datastore.threshold_seconds) @@ -873,8 +873,5 @@ def ticker_thread_check_time_launch_checks(): # Reset for next time watch.jitter_seconds = 0 - # Wait before checking the list again - saves CPU - time.sleep(1) - # Should be low so we can break this out in testing app.config.exit.wait(1)