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

@@ -28,8 +28,16 @@ def task_activity_callback(self, pid, trigger, tp, *args, **kwargs):
@shared_task(
queue='ansible', verbose_name=_('Account execute automation'),
activity_callback=task_activity_callback
queue='ansible',
verbose_name=_('Account execute automation'),
activity_callback=task_activity_callback,
description=_(
"""
Unified execution entry for account automation tasks: when the system performs tasks
such as account push, password change, account verification, account collection,
and gateway account verification, all tasks are executed through this unified entry
"""
)
)
def execute_account_automation_task(pid, trigger, tp):
model = AutomationTypes.get_type_model(tp)
@@ -54,8 +62,14 @@ def record_task_activity_callback(self, record_ids, *args, **kwargs):
@shared_task(
queue='ansible', verbose_name=_('Execute automation record'),
activity_callback=record_task_activity_callback
queue='ansible',
verbose_name=_('Execute automation record'),
activity_callback=record_task_activity_callback,
description=_(
"""
When manually executing password change records, this task is used
"""
)
)
def execute_automation_record_task(record_ids, tp):
from accounts.models import ChangeSecretRecord
@@ -84,7 +98,11 @@ def execute_automation_record_task(record_ids, tp):
@shared_task(
verbose_name=_('Clean change secret and push record period'),
description=_('Clean change secret and push record period description')
description=_(
"""
Clean change secret and push record period description
"""
)
)
@register_as_period_task(crontab=CRONTAB_AT_AM_THREE)
def clean_change_secret_and_push_record_period():