mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add task to check for old files every 12 hours
This commit is contained in:
parent
ab344cbff4
commit
f090bf8c6f
@ -672,6 +672,15 @@ class TasksManager:
|
||||
HelperUsers.update_user(
|
||||
user.id, {"pfp": self.helper.get_gravatar_image(user.email)}
|
||||
)
|
||||
# Search for old files in imports
|
||||
for file in os.listdir(os.path.join(self.controller.project_root), "imports"):
|
||||
if self.helper.is_file_older_than_x_days(
|
||||
os.path.join(self.controller.project_root), "imports", file
|
||||
):
|
||||
try:
|
||||
os.remove(os.path.join(file))
|
||||
except:
|
||||
logger.debug("Could not clear out file from import directory")
|
||||
|
||||
def log_watcher(self):
|
||||
self.controller.servers.check_for_old_logs()
|
||||
|
Loading…
Reference in New Issue
Block a user