perf: clean mp4 replay file

pull/13596/head
Eric 2024-06-25 16:31:32 +08:00 committed by 老广
parent 1701bedb41
commit 22d7385891
1 changed files with 3 additions and 2 deletions

View File

@ -105,8 +105,9 @@ def clean_expired_session_period():
logger.info("Clean session item done") logger.info("Clean session item done")
batch_delete(expired_commands) batch_delete(expired_commands)
logger.info("Clean session command done") logger.info("Clean session command done")
command = "find %s -mtime +%s \\( -name '*.json' -o -name '*.tar' -o -name '*.gz' \\) -exec rm -f {} \\;" % ( file_types = "-name '*.json' -o -name '*.tar' -o -name '*.gz' -o -name '*.mp4'"
replay_dir, days command = "find %s -mtime +%s \\( %s \\) -exec rm -f {} \\;" % (
replay_dir, days, file_types
) )
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
command = "find %s -type d -empty -delete;" % replay_dir command = "find %s -type d -empty -delete;" % replay_dir