mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-18 17:15:13 +01: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(
|
self.helper.ensure_dir_exists(
|
||||||
os.path.join(self.controller.project_root, "import", "upload")
|
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(
|
for file in os.listdir(
|
||||||
os.path.join(self.controller.project_root, "import", "upload")
|
os.path.join(self.controller.project_root, "import", "upload")
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user