Remove debug logging and optimize file removal in Job class

This commit is contained in:
Théophile Diot 2024-03-13 09:44:34 +00:00
parent 616c07e964
commit ccdeeb14be
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -85,7 +85,6 @@ class Job:
if not manual:
for file in self.job_path.glob("**/*"):
self.logger.debug(f"file : {file}")
skipped = False
for ignored_dir in ignored_dirs:
if file.as_posix().startswith(ignored_dir.as_posix()):
@ -95,6 +94,7 @@ class Job:
if skipped:
continue
self.logger.debug(f"Checking if {file} should be removed")
if file not in plugin_cache_files and file.is_file():
self.logger.debug(f"Removing non-cached file {file}")
file.unlink(missing_ok=True)