From 19c76ba01cdf6b1d8dc283e8a2772fe490b20326 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 19 Sep 2023 14:13:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=88=A0=E9=99=A4=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=9C=BA=E6=89=A7=E8=A1=8C=E7=9A=84=E4=BB=BB=E5=8A=A1=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/automations/deploy_applet_host/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/terminal/automations/deploy_applet_host/__init__.py b/apps/terminal/automations/deploy_applet_host/__init__.py index 449306a92..ab68bdfef 100644 --- a/apps/terminal/automations/deploy_applet_host/__init__.py +++ b/apps/terminal/automations/deploy_applet_host/__init__.py @@ -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()