mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 15:25:41 +01:00
Consume documents in order of increasing mtime
This increases overall usability, especially for multi-page scans. Previously, the consumption order was undefined (see os.listdir())
This commit is contained in:
parent
873c98dddb
commit
2fe7df8ca0
1 changed files with 4 additions and 1 deletions
|
|
@ -71,8 +71,11 @@ class Consumer:
|
|||
})
|
||||
|
||||
def run(self):
|
||||
docs = [os.path.join(self.consume, entry)
|
||||
for entry in os.listdir(self.consume)]
|
||||
docs_old_to_new = sorted(docs, key=lambda doc: os.path.getmtime(doc))
|
||||
|
||||
for doc in os.listdir(self.consume):
|
||||
for doc in docs_old_to_new:
|
||||
|
||||
doc = os.path.join(self.consume, doc)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue