mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Delete temp dir files every 12 hours
This commit is contained in:
parent
b0a38d1249
commit
87c559ae66
@ -799,6 +799,18 @@ class TasksManager:
|
||||
self.helper.ensure_dir_exists(
|
||||
os.path.join(self.controller.project_root, "import", "upload")
|
||||
)
|
||||
self.helper.ensure_dir_exists(
|
||||
os.path.join(self.controller.project_root, "temp")
|
||||
)
|
||||
for file in os.listdir(os.path.join(self.controller.project_root, "temp")):
|
||||
if self.helper.is_file_older_than_x_days(
|
||||
os.path.join(self.controller.project_root, "temp", file)
|
||||
):
|
||||
try:
|
||||
os.remove(os.path.join(file))
|
||||
except:
|
||||
logger.debug("Could not clear out file from temp directory")
|
||||
|
||||
for file in os.listdir(
|
||||
os.path.join(self.controller.project_root, "import", "upload")
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user