Skip to content

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

Run a --oneshot loop twice

Daniel Quinnd0252e8e44a9
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py
index dbd7e3264..f94265b65 100644
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@ -99,5 +99,7 @@ class Command(BaseCommand):
self.first_iteration = False
self.mail_fetcher.pull()
- # Consume whatever files we can
- self.file_consumer.run()
+ # Consume whatever files we can.
+ # We have to run twice as the first run checks for file readiness
+ for i in range(2):
+ self.file_consumer.run()