mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-03 11:29:28 -05:00
Use os.scandir instead of os.listdir
It's simpler and better suited for use cases introduced in later commits.
This commit is contained in:
parent
2c64e70754
commit
312a6a91b5
@ -71,8 +71,7 @@ class Consumer:
|
|||||||
})
|
})
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
docs = [os.path.join(self.consume, entry)
|
docs = [entry.path for entry in os.scandir(self.consume)]
|
||||||
for entry in os.listdir(self.consume)]
|
|
||||||
docs_old_to_new = sorted(docs, key=lambda doc: os.path.getmtime(doc))
|
docs_old_to_new = sorted(docs, key=lambda doc: os.path.getmtime(doc))
|
||||||
|
|
||||||
for doc in docs_old_to_new:
|
for doc in docs_old_to_new:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user