From f25cdf0a674c8356861e737c745e6796b8853814 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 8 Feb 2022 18:27:56 +0100 Subject: [PATCH] Number of fetching workers can be overriden by Env "FETCH_WORKERS" (#413) --- changedetectionio/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 574228eb..9285ac45 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -1041,8 +1041,10 @@ def notification_runner(): def ticker_thread_check_time_launch_checks(): from changedetectionio import update_worker - # Spin up Workers. - for _ in range(datastore.data['settings']['requests']['workers']): + # Spin up Workers that do the fetching + # Can be overriden by ENV or use the default settings + n_workers = os.getenv("FETCH_WORKERS", datastore.data['settings']['requests']['workers']) + for _ in range(n_workers): new_worker = update_worker.update_worker(update_q, notification_q, app, datastore) running_update_threads.append(new_worker) new_worker.start()