From 30515c0e9fc43e25a63532518320305a37d45143 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 10 Nov 2024 10:21:18 +0100 Subject: [PATCH] More debug around queue size --- changedetectionio/flask_app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 5be46e1c359..25179a56a3c 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -53,6 +53,7 @@ update_q = queue.PriorityQueue() notification_q = queue.Queue() +MAX_QUEUE_SIZE = 2000 app = Flask(__name__, static_url_path="", @@ -1742,12 +1743,14 @@ def ticker_thread_check_time_launch_checks(): except RuntimeError as e: # RuntimeError: dictionary changed size during iteration time.sleep(0.1) + watch_uuid_list = [] else: break # Re #438 - Don't place more watches in the queue to be checked if the queue is already large while update_q.qsize() >= 2000: - time.sleep(1) + logger.warning(f"Recheck watches queue size limit reached ({MAX_QUEUE_SIZE}), skipping adding more items") + time.sleep(3) recheck_time_system_seconds = int(datastore.threshold_seconds)