Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit f9fe146

Browse files
author
evilsidekick
committed
Make Worker Timeout Configurable
- defaults to 1800 seconds - can be configured through environment for systems with weaker CPUs - description added to documentation
1 parent 5612ad0 commit f9fe146

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,12 @@ PAPERLESS_THREADS_PER_WORKER=<num>
507507
PAPERLESS_THREADS_PER_WORKER automatically.
508508

509509

510+
PAPERLESS_WORKER_TIMEOUT=<num>
511+
Machines with few cores or weak ones might not be able to finish OCR on
512+
large documents within the default 1800 seconds. So extending this timeout
513+
may prove be useful on weak hardware setups.
514+
515+
510516
PAPERLESS_TIME_ZONE=<timezone>
511517
Set the time zone here.
512518
See https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-TIME_ZONE

src/paperless/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def default_task_workers():
422422
'catch_up': False,
423423
'recycle': 1,
424424
'retry': 1800,
425-
'timeout': 1800,
425+
'timeout': int(os.getenv("PAPERLESS_WORKER_TIMEOUT", 1800)),
426426
'workers': TASK_WORKERS,
427427
'redis': os.getenv("PAPERLESS_REDIS", "redis://localhost:6379")
428428
}

0 commit comments

Comments
 (0)