From 22d7385891a3fb36947af1fb58483856d8343a07 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 25 Jun 2024 16:31:32 +0800 Subject: [PATCH] perf: clean mp4 replay file --- apps/audits/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/audits/tasks.py b/apps/audits/tasks.py index ac28e91cb..186f7e57d 100644 --- a/apps/audits/tasks.py +++ b/apps/audits/tasks.py @@ -105,8 +105,9 @@ def clean_expired_session_period(): logger.info("Clean session item done") batch_delete(expired_commands) logger.info("Clean session command done") - command = "find %s -mtime +%s \\( -name '*.json' -o -name '*.tar' -o -name '*.gz' \\) -exec rm -f {} \\;" % ( - replay_dir, days + file_types = "-name '*.json' -o -name '*.tar' -o -name '*.gz' -o -name '*.mp4'" + command = "find %s -mtime +%s \\( %s \\) -exec rm -f {} \\;" % ( + replay_dir, days, file_types ) subprocess.call(command, shell=True) command = "find %s -type d -empty -delete;" % replay_dir