From f9fe146b0139a7a34ce3ce7647e81c6725b59858 Mon Sep 17 00:00:00 2001 From: evilsidekick <> Date: Sun, 5 Dec 2021 19:23:47 +0100 Subject: [PATCH] Make Worker Timeout Configurable - defaults to 1800 seconds - can be configured through environment for systems with weaker CPUs - description added to documentation --- docs/configuration.rst | 6 ++++++ src/paperless/settings.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 7d079a96c..2fd59ff66 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -507,6 +507,12 @@ PAPERLESS_THREADS_PER_WORKER= PAPERLESS_THREADS_PER_WORKER automatically. +PAPERLESS_WORKER_TIMEOUT= + Machines with few cores or weak ones might not be able to finish OCR on + large documents within the default 1800 seconds. So extending this timeout + may prove be useful on weak hardware setups. + + PAPERLESS_TIME_ZONE= Set the time zone here. See https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-TIME_ZONE diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 5f03a406e..554f9fa0d 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -422,7 +422,7 @@ def default_task_workers(): 'catch_up': False, 'recycle': 1, 'retry': 1800, - 'timeout': 1800, + 'timeout': int(os.getenv("PAPERLESS_WORKER_TIMEOUT", 1800)), 'workers': TASK_WORKERS, 'redis': os.getenv("PAPERLESS_REDIS", "redis://localhost:6379") }