From 6158290edcf3a6b51c7223a37b3eee09717b7cc2 Mon Sep 17 00:00:00 2001 From: durant <826035498@qq.com> Date: Mon, 2 Dec 2024 16:09:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(backend):=20=E8=B0=83=E6=95=B4=E5=91=A8?= =?UTF-8?q?=E6=9C=9F=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=20#8342?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py index 38bdbcefa2..d209197a34 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_monitor.py @@ -28,14 +28,14 @@ logger = logging.getLogger("celery") -@register_periodic_task(run_every=crontab(hour="*/6", minute="0")) +@register_periodic_task(run_every=crontab(hour="0", minute="0")) def update_local_notice_group(): """同步告警组""" dba_ids = DBAdministrator.objects.values_list("id", flat=True) count = len(dba_ids) # 同步 DBA 内置告警组 for index, dba_id in enumerate(dba_ids): - countdown = calculate_countdown(count=count, index=index, duration=6 * TimeUnit.HOUR) + countdown = calculate_countdown(count=count, index=index, duration=8 * TimeUnit.HOUR) logger.info("dba_id({}) update notice group will be run after {} seconds.".format(dba_id, countdown)) with start_new_span(update_dba_notice_group): update_dba_notice_group.apply_async(kwargs={"dba_id": dba_id}, countdown=countdown) @@ -81,7 +81,7 @@ def sync_plat_monitor_policy(action_id=None, db_type=None, force=False): MonitorPolicy.sync_plat_monitor_policy(action_id=action_id, db_type=db_type, force=force) -@register_periodic_task(run_every=crontab(minute=0, hour="*/1")) +@register_periodic_task(run_every=crontab(minute=0, hour="*/2")) def sync_plat_dispatch_policy(): """同步平台分派通知策略 按照app_id->db_type来拆分策略: @@ -94,7 +94,7 @@ def sync_plat_dispatch_policy(): count = len(biz_ids) # 同步平台/业务分派策略 for index, bk_biz_id in enumerate(biz_ids): - countdown = calculate_countdown(count=count, index=index, duration=TimeUnit.HOUR) + countdown = calculate_countdown(count=count, index=index, duration=2 * TimeUnit.HOUR) logger.info("biz({}) sync dispatch policy will be run after {} seconds.".format(bk_biz_id, countdown)) with start_new_span(sync_biz_dispatch_policy): sync_biz_dispatch_policy.apply_async(kwargs={"bk_biz_id": bk_biz_id}, countdown=countdown)