From 839e11b5750dc0ca1b8e9489f33b1150d5d9d710 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 11 Nov 2022 14:30:14 +0800 Subject: [PATCH] clear_dbbackup bug --- apps/monitor/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/monitor/tasks.py b/apps/monitor/tasks.py index 8ca22616..feefdf8c 100644 --- a/apps/monitor/tasks.py +++ b/apps/monitor/tasks.py @@ -29,7 +29,7 @@ def clear_dbbackup(num: int=7): from apps.monitor.views import get_file_list backpath = settings.BACKUP_PATH + '/database' files = get_file_list(backpath) - files_remove_list = files[6:] + files_remove_list = files[num:] for f in files_remove_list: filepath = os.path.join(backpath, f) os.remove(filepath)