mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -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:
		| @@ -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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Erik Arvstedt
					Erik Arvstedt