A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fetch emails right at startup instead of waiting for 10 minutes.
David Martin3153bbd6a8d6
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.pyindex d3b406fe7..f50b489ee 100644--- a/src/documents/management/commands/document_consumer.py+++ b/src/documents/management/commands/document_consumer.py@@ -28,6 +28,7 @@ class Command(BaseCommand):self.file_consumer = Noneself.mail_fetcher = None+ self.first_iteration = TrueBaseCommand.__init__(self, *args, **kwargs)@@ -66,6 +67,9 @@ class Command(BaseCommand):self.file_consumer.consume()# Occasionally fetch mail and store it to be consumed on the next loop+ # We fetch email when we first start up so that it is not necessary to+ # wait for 10 minutes after making changes to the config file.delta = self.mail_fetcher.last_checked + self.MAIL_DELTA- if delta < datetime.datetime.now():+ if self.first_iteration or delta < datetime.datetime.now():+ self.first_iteration = Falseself.mail_fetcher.pull()