mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Cleanup temp dirs on support log creation
This commit is contained in:
parent
39915ef53c
commit
5d3badef2c
@ -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",
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user