Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Consumer loop time is now configurable

Daniel Quinn23bd887f1685
diff --git a/paperless.conf.example b/paperless.conf.example
index abb93eefe..f03bd2677 100644
--- a/paperless.conf.example
+++ b/paperless.conf.example
@@ -87,3 +87,8 @@ PAPERLESS_SHARED_SECRET=""
# Override the default MEDIA_ROOT here. This is where all files are stored.
#PAPERLESS_MEDIADIR=/path/to/media
+
+# The number of seconds that Paperless will wait between checking
+# PAPERLESS_CONSUMPTION_DIR. If you tend to write documents to this directory
+# very slowly, you may want to use a higher value than the default (10).
+# PAPERLESS_CONSUMER_LOOP_TIME=10
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py
index 366e75657..d3b406fe7 100644
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@ -16,7 +16,7 @@ class Command(BaseCommand):
consumption directory, and fetch any mail available.
"""
- LOOP_TIME = 10 # Seconds
+ LOOP_TIME = settings.CONSUMER_LOOP_TIME
MAIL_DELTA = datetime.timedelta(minutes=10)
ORIGINAL_DOCS = os.path.join(settings.MEDIA_ROOT, "documents", "originals")
diff --git a/src/paperless/settings.py b/src/paperless/settings.py
index 5cf66d335..bc6674e88 100644
--- a/src/paperless/settings.py
+++ b/src/paperless/settings.py
@@ -211,6 +211,11 @@ SCRATCH_DIR = os.getenv("PAPERLESS_SCRATCH_DIR", "/tmp/paperless")
# This is where Paperless will look for PDFs to index
CONSUMPTION_DIR = os.getenv("PAPERLESS_CONSUMPTION_DIR")
+# The number of seconds that Paperless will wait between checking
+# CONSUMPTION_DIR. If you tend to write documents to this directory very
+# slowly, you may want to use a higher value than the default.
+CONSUMER_LOOP_TIME = int(os.getenv("PAPERLESS_CONSUMER_LOOP_TIME", 10))
+
# If you want to use IMAP mail consumption, populate this with useful values.
# If you leave HOST set to None, we assume you're not going to use this
# feature.