添加celery任务
This commit is contained in:
parent
1a1775edb4
commit
f89c37855b
|
@ -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)
|
|
@ -14,14 +14,10 @@ app.autodiscover_tasks()
|
||||||
|
|
||||||
# 定时任务的调度列表,用于注册定时任务
|
# 定时任务的调度列表,用于注册定时任务
|
||||||
app.conf.beat_schedule = {
|
app.conf.beat_schedule = {
|
||||||
'warning_log': {
|
# 'warning_log': {
|
||||||
'task': 'warning_log',
|
# 'task': 'warning_log',
|
||||||
'schedule': timedelta(minutes=1),
|
# 'schedule': timedelta(minutes=1),
|
||||||
},
|
# },
|
||||||
'check_authorization_task': {
|
|
||||||
'task': 'check_authorization_task',
|
|
||||||
'schedule': timedelta(minutes=30),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task_routes = {
|
task_routes = {
|
||||||
|
|
Loading…
Reference in New Issue