Run a --oneshot loop twice

This was necessary since the first loop only ever collects file
statistics so that the second run can be sure about "readiness".
This commit is contained in:
Daniel Quinn 2018-03-03 18:42:41 +00:00
parent 73e62600c2
commit d0252e8e44

@ -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()