fix: 重启服务禁用的定时任务会执行问题

pull/13045/head
wangruidong 7 months ago committed by 老广
parent 5a9815481a
commit ac988a76b4

@ -26,6 +26,10 @@ def on_app_ready(sender=None, headers=None, **kwargs):
logger.debug("Work ready signal recv") logger.debug("Work ready signal recv")
logger.debug("Start need start task: [{}]".format(", ".join(tasks))) logger.debug("Start need start task: [{}]".format(", ".join(tasks)))
for task in 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() subtask(task).delay()

Loading…
Cancel
Save