-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(celery-task): 优化检查节点资产数量的 Celery 任务 (#5052)
Co-authored-by: xinwen <coderWen@126.com>
- Loading branch information
Showing
5 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
from celery import shared_task | ||
|
||
from ops.celery.decorator import register_as_period_task | ||
from assets.utils import check_node_assets_amount | ||
from common.utils import get_logger | ||
from common.utils.timezone import now | ||
|
||
logger = get_logger(__file__) | ||
|
||
|
||
@shared_task() | ||
@register_as_period_task(crontab='* 2 * * *') | ||
@shared_task(queue='celery_heavy_tasks') | ||
def check_node_assets_amount_celery_task(): | ||
logger.info(f'>>> {now()} begin check_node_assets_amount_celery_task ...') | ||
check_node_assets_amount() | ||
logger.info(f'>>> {now()} end check_node_assets_amount_celery_task ...') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters