perf: Add task description (#14033)

Co-authored-by: ZhaoJiSen <97007455+ZhaoJiSen@users.noreply.github.com>
This commit is contained in:
fit2bot
2024-09-09 18:54:33 +08:00
committed by GitHub
parent bd548b3fe2
commit 1417abecfb
29 changed files with 1129 additions and 148 deletions

View File

@@ -21,8 +21,15 @@ __all__ = ['remove_accounts_task']
@shared_task(
queue="ansible", verbose_name=_('Remove account'),
activity_callback=lambda self, gather_account_ids, *args, **kwargs: (gather_account_ids, None)
queue="ansible",
verbose_name=_('Remove account'),
activity_callback=lambda self, gather_account_ids, *args, **kwargs: (gather_account_ids, None),
description=_(
"""
When clicking "Sync deletion" in 'Console - Gather Account - Gathered accounts' this
task will be executed
"""
)
)
def remove_accounts_task(gather_account_ids):
from accounts.models import GatheredAccount
@@ -41,7 +48,17 @@ def remove_accounts_task(gather_account_ids):
quickstart_automation_by_snapshot(task_name, tp, task_snapshot)
@shared_task(verbose_name=_('Clean historical accounts'))
@shared_task(
verbose_name=_('Clean historical accounts'),
description=_(
"""
Each time an asset account is updated, a historical account is generated, so it is
necessary to clean up the asset account history. The system will clean up excess account
records at 2 a.m. daily based on the configuration in the "System settings - Features -
Account storage - Record limit
"""
)
)
@register_as_period_task(crontab=CRONTAB_AT_AM_TWO)
@tmp_to_root_org()
def clean_historical_accounts():