fix: 修复历史会话文件不能被清理的bug (#7604)

* fix: 修复历史会话文件不能被清理的bug

* perf: 删除调试日志

Co-authored-by: halo <wuyihuangw@gmail.com>
pull/7611/head
fit2bot 2022-02-14 10:58:30 +08:00 committed by GitHub
parent ab34b9906e
commit 597b022905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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)