Number of fetching workers can be overriden by Env "FETCH_WORKERS" (#413)

pull/414/head
dgtlmoon 2022-02-08 18:27:56 +01:00 zatwierdzone przez GitHub
rodzic 5214a7e0f3
commit f25cdf0a67
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -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()