mirror of https://github.com/jumpserver/jumpserver
perf: 删除发布机执行的任务目录
parent
68c4cd5928
commit
19c76ba01c
|
@ -1,5 +1,6 @@
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -116,6 +117,11 @@ class DeployAppletHostManager:
|
||||||
)
|
)
|
||||||
return runner.run(**kwargs)
|
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):
|
def _run(self, cb_func: callable, **kwargs):
|
||||||
try:
|
try:
|
||||||
self.deployment.date_start = timezone.now()
|
self.deployment.date_start = timezone.now()
|
||||||
|
@ -128,3 +134,4 @@ class DeployAppletHostManager:
|
||||||
self.deployment.date_finished = timezone.now()
|
self.deployment.date_finished = timezone.now()
|
||||||
with safe_db_connection():
|
with safe_db_connection():
|
||||||
self.deployment.save()
|
self.deployment.save()
|
||||||
|
self.delete_runtime_dir()
|
||||||
|
|
Loading…
Reference in New Issue