From ac988a76b48f6de56c0bea96310188e849aee2e6 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Wed, 17 Apr 2024 10:48:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E5=90=AF=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=9A=84=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BC=9A=E6=89=A7=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/celery/signal_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/ops/celery/signal_handler.py b/apps/ops/celery/signal_handler.py index bfd68508a..4ce8d0f38 100644 --- a/apps/ops/celery/signal_handler.py +++ b/apps/ops/celery/signal_handler.py @@ -26,6 +26,10 @@ def on_app_ready(sender=None, headers=None, **kwargs): logger.debug("Work ready signal recv") logger.debug("Start need start task: [{}]".format(", ".join(tasks))) for task in tasks: + periodic_task = PeriodicTask.objects.filter(task=task).first() + if periodic_task and not periodic_task.enabled: + logger.debug("Periodic task [{}] is disabled!".format(task)) + continue subtask(task).delay()