Cleanup temp dirs on support log creation

This commit is contained in:
Andrew 2022-06-01 17:54:58 -04:00
parent 39915ef53c
commit 5d3badef2c
2 changed files with 9 additions and 0 deletions

View File

@ -231,6 +231,14 @@ class Controller:
self.users.stop_prepare(exec_user["user_id"])
self.support_scheduler.remove_job("logs_" + str(exec_user["user_id"]))
FileHelpers.del_dirs(temp_dir)
def del_support_file(temp_zip_storage):
try:
FileHelpers.del_file(temp_zip_storage)
except FileNotFoundError:
logger.info("No temp file found. Assuming it's already been cleaned up")
def add_system_user(self):
self.users_helper.add_user(
"system",

View File

@ -1209,6 +1209,7 @@ class PanelHandler(BaseHandler):
# same time, the chunks in memory will keep
# increasing and will eat up the RAM
del chunk
self.controller.del_support_file(temp_zip_storage)
self.redirect("/panel/dashboard")
else:
self.redirect("/panel/error?error=No path found for support logs")