mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-19 01:07:51 +00:00
perf: 删除发布机执行的任务目录
This commit is contained in:
parent
68c4cd5928
commit
19c76ba01c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user