mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-31 12:56:11 +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.users.stop_prepare(exec_user["user_id"])
|
||||||
self.support_scheduler.remove_job("logs_" + str(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):
|
def add_system_user(self):
|
||||||
self.users_helper.add_user(
|
self.users_helper.add_user(
|
||||||
"system",
|
"system",
|
||||||
|
@ -1209,6 +1209,7 @@ class PanelHandler(BaseHandler):
|
|||||||
# same time, the chunks in memory will keep
|
# same time, the chunks in memory will keep
|
||||||
# increasing and will eat up the RAM
|
# increasing and will eat up the RAM
|
||||||
del chunk
|
del chunk
|
||||||
|
self.controller.del_support_file(temp_zip_storage)
|
||||||
self.redirect("/panel/dashboard")
|
self.redirect("/panel/dashboard")
|
||||||
else:
|
else:
|
||||||
self.redirect("/panel/error?error=No path found for support logs")
|
self.redirect("/panel/error?error=No path found for support logs")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user