From 597b02290537e19d7a82ee66422f54c9750a39f8 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E6=96=87=E4=BB=B6=E4=B8=8D=E8=83=BD=E8=A2=AB?= =?UTF-8?q?=E6=B8=85=E7=90=86=E7=9A=84bug=20(#7604)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复历史会话文件不能被清理的bug * perf: 删除调试日志 Co-authored-by: halo --- apps/terminal/tasks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/terminal/tasks.py b/apps/terminal/tasks.py index 300aa0d0d..0f19d0435 100644 --- a/apps/terminal/tasks.py +++ b/apps/terminal/tasks.py @@ -18,7 +18,6 @@ from .models import Status, Session, Command from .backends import server_replay_storage from .utils import find_session_replay_local - CACHE_REFRESH_INTERVAL = 10 RUNNING = False logger = get_task_logger(__name__) @@ -64,7 +63,7 @@ def clean_expired_session_period(): logger.info("Clean session item done") expired_commands.delete() logger.info("Clean session command done") - command = "find %s -mtime +%s -name '*.gz' -exec rm -f {} \\;" % ( + command = "find %s -mtime +%s \\( -name '*.json' -o -name '*.tar' -o -name '*.gz' \\) -exec rm -f {} \\;" % ( replay_dir, days ) subprocess.call(command, shell=True)