mirror of
https://github.com/taskPyroer/DjangoVue3Admin.git
synced 2026-10-03 00:21:05 +00:00
28 lines
629 B
Python
28 lines
629 B
Python
"""
|
||
Time: 2023/11/21 15:37
|
||
Author: 公众号【布鲁的Python之旅】,【github】https://github.com/taskPyroer, 【gitee】https://gitee.com/hu_yupeng123/projects
|
||
Version: V 0.1
|
||
File: tasks
|
||
Describe:
|
||
"""
|
||
from application.celery import app
|
||
from celery import shared_task
|
||
|
||
|
||
@app.task(bind=True)
|
||
def cron_job_test(self):
|
||
print(self.request)
|
||
return "cron_job_test running"
|
||
|
||
|
||
@shared_task
|
||
def cron_job_add(x, y):
|
||
print("cron_job_add running")
|
||
return f"cron_job_add running: {x + y}"
|
||
|
||
|
||
@shared_task
|
||
def cron_job_mul(x, y):
|
||
print("cron_job_mul running")
|
||
return f"cron_job_mul running: {x * y}"
|