mirror of https://github.com/jumpserver/jumpserver
fix: 修复历史会话文件不能被清理的bug (#7604)
* fix: 修复历史会话文件不能被清理的bug * perf: 删除调试日志 Co-authored-by: halo <wuyihuangw@gmail.com>pull/7611/head
parent
ab34b9906e
commit
597b022905
|
@ -18,7 +18,6 @@ from .models import Status, Session, Command
|
||||||
from .backends import server_replay_storage
|
from .backends import server_replay_storage
|
||||||
from .utils import find_session_replay_local
|
from .utils import find_session_replay_local
|
||||||
|
|
||||||
|
|
||||||
CACHE_REFRESH_INTERVAL = 10
|
CACHE_REFRESH_INTERVAL = 10
|
||||||
RUNNING = False
|
RUNNING = False
|
||||||
logger = get_task_logger(__name__)
|
logger = get_task_logger(__name__)
|
||||||
|
@ -64,7 +63,7 @@ def clean_expired_session_period():
|
||||||
logger.info("Clean session item done")
|
logger.info("Clean session item done")
|
||||||
expired_commands.delete()
|
expired_commands.delete()
|
||||||
logger.info("Clean session command done")
|
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
|
replay_dir, days
|
||||||
)
|
)
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
Loading…
Reference in New Issue