perf: account task timing not triggered (#9564)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-02-15 16:48:27 +08:00
committed by GitHub
parent 4109f2cb1c
commit 4ac214e91d
4 changed files with 15 additions and 6 deletions

View File

@@ -3,7 +3,6 @@
from celery import shared_task
from django.utils.translation import gettext_lazy as _
from accounts.models import AccountBackupAutomation
from common.utils import get_object_or_none, get_logger
from orgs.utils import tmp_to_org, tmp_to_root_org
@@ -12,6 +11,7 @@ logger = get_logger(__file__)
@shared_task(verbose_name=_('Execute account backup plan'))
def execute_account_backup_plan(pid, trigger):
from accounts.models import AccountBackupAutomation
with tmp_to_root_org():
plan = get_object_or_none(AccountBackupAutomation, pk=pid)
if not plan: