From 04e102cb87bef6bc17f0ed5a0dde8589b3df4ce5 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Wed, 10 Jul 2024 15:37:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E6=B8=85=E7=90=86?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audits/tasks.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/audits/tasks.py b/apps/audits/tasks.py index 186f7e57d..944306c06 100644 --- a/apps/audits/tasks.py +++ b/apps/audits/tasks.py @@ -16,6 +16,7 @@ from common.storage.ftp_file import FTPFileStorageHandler from common.utils import get_log_keep_day, get_logger from ops.celery.decorator import register_as_period_task from ops.models import CeleryTaskExecution +from orgs.utils import tmp_to_root_org from terminal.backends import server_replay_storage from terminal.models import Session, Command from .models import UserLoginLog, OperateLog, FTPLog, ActivityLog, PasswordChangeLog @@ -119,13 +120,14 @@ def clean_expired_session_period(): @register_as_period_task(crontab=CRONTAB_AT_AM_TWO) def clean_audits_log_period(): print("Start clean audit session task log") - clean_login_log_period() - clean_operation_log_period() - clean_ftp_log_period() - clean_activity_log_period() - clean_celery_tasks_period() - clean_expired_session_period() - clean_password_change_log_period() + with tmp_to_root_org(): + clean_login_log_period() + clean_operation_log_period() + clean_ftp_log_period() + clean_activity_log_period() + clean_celery_tasks_period() + clean_expired_session_period() + clean_password_change_log_period() @shared_task(verbose_name=_('Upload FTP file to external storage'))