From f89c37855b1e4edba16072f7f6f63dd93f04bdc2 Mon Sep 17 00:00:00 2001 From: AKW <2497744746@qq.com> Date: Wed, 13 Dec 2023 15:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0celery=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jqr/tasks.py | 7 +++++++ yzk_wechat_event/celery.py | 12 ++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/jqr/tasks.py b/apps/jqr/tasks.py index e69de29..037886d 100644 --- a/apps/jqr/tasks.py +++ b/apps/jqr/tasks.py @@ -0,0 +1,7 @@ +from celery import shared_task + + +@shared_task(name='save_add_contact') +def save_add_contact(*args, **kwargs): + print(args) + print(kwargs) diff --git a/yzk_wechat_event/celery.py b/yzk_wechat_event/celery.py index 966d0fd..36f0b63 100644 --- a/yzk_wechat_event/celery.py +++ b/yzk_wechat_event/celery.py @@ -14,14 +14,10 @@ app.autodiscover_tasks() # 定时任务的调度列表,用于注册定时任务 app.conf.beat_schedule = { - 'warning_log': { - 'task': 'warning_log', - 'schedule': timedelta(minutes=1), - }, - 'check_authorization_task': { - 'task': 'check_authorization_task', - 'schedule': timedelta(minutes=30), - }, + # 'warning_log': { + # 'task': 'warning_log', + # 'schedule': timedelta(minutes=1), + # }, } task_routes = {