mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-01 11:19:32 -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):
|
||||
docs = [os.path.join(self.consume, entry)
|
||||
for entry in os.listdir(self.consume)]
|
||||
docs = [entry.path for entry in os.scandir(self.consume)]
|
||||
docs_old_to_new = sorted(docs, key=lambda doc: os.path.getmtime(doc))
|
||||
|
||||
for doc in docs_old_to_new:
|
||||
|
Loading…
x
Reference in New Issue
Block a user