mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-27 15:54:14 +00:00
perf: 删除发布机执行的任务目录
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import yaml
|
||||
from django.conf import settings
|
||||
@@ -116,6 +117,11 @@ class DeployAppletHostManager:
|
||||
)
|
||||
return runner.run(**kwargs)
|
||||
|
||||
def delete_runtime_dir(self):
|
||||
if settings.DEBUG_DEV:
|
||||
return
|
||||
shutil.rmtree(self.run_dir)
|
||||
|
||||
def _run(self, cb_func: callable, **kwargs):
|
||||
try:
|
||||
self.deployment.date_start = timezone.now()
|
||||
@@ -128,3 +134,4 @@ class DeployAppletHostManager:
|
||||
self.deployment.date_finished = timezone.now()
|
||||
with safe_db_connection():
|
||||
self.deployment.save()
|
||||
self.delete_runtime_dir()
|
||||
|
Reference in New Issue
Block a user