mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bug/pretzel-support-log-temp-cleanup' into 'dev'
Cleanup temp dirs on support log creation See merge request crafty-controller/crafty-4!286
This commit is contained in:
commit
ec730a1694
@ -148,6 +148,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(self, 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",
|
||||||
|
@ -1220,6 +1220,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…
Reference in New Issue
Block a user