mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Ensure docs have been unmodified for some time before consuming
Previously, the second mtime check for new files usually happened right after the first one, which could have caused consumption of docs that were still being modified. We're now waiting for at least FILES_MIN_UNMODIFIED_DURATION (0.5s). This also cleans up the logic by eliminating the consumer.stats attribute and the weird double call to consumer.run(). Additionally, this a fixes memory leak in consumer.stats where paths could be added but never removed if the corresponding files disappeared from the consumer dir before being considered ready.
This commit is contained in:
@@ -95,7 +95,4 @@ class Command(BaseCommand):
|
||||
self.first_iteration = False
|
||||
self.mail_fetcher.pull()
|
||||
|
||||
# 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()
|
||||
self.file_consumer.consume_new_files()
|
||||
|
Reference in New Issue
Block a user