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

Commit

Permalink
Make Worker Timeout Configurable
Browse files Browse the repository at this point in the history
- defaults to 1800 seconds
- can be configured through environment for systems with weaker CPUs
- description added to documentation
  • Loading branch information
evilsidekick committed Dec 6, 2021
1 parent 5612ad0 commit f9fe146
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ PAPERLESS_THREADS_PER_WORKER=<num>
PAPERLESS_THREADS_PER_WORKER automatically.


PAPERLESS_WORKER_TIMEOUT=<num>
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=<timezone>
Set the time zone here.
See https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-TIME_ZONE
Expand Down
2 changes: 1 addition & 1 deletion src/paperless/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit f9fe146

Please sign in to comment.