mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-26 04:33:09 +08:00
25 lines
713 B
Python
25 lines
713 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from celery.schedules import schedule
|
|
|
|
from backend.app.task.utils.tzcrontab import TzAwareCrontab
|
|
|
|
LOCAL_BEAT_SCHEDULE = {
|
|
'测试同步任务': {
|
|
'task': 'task_demo',
|
|
'schedule': schedule(5),
|
|
},
|
|
'测试异步任务': {
|
|
'task': 'task_demo_async',
|
|
'schedule': TzAwareCrontab('1'),
|
|
},
|
|
'清理操作日志': {
|
|
'task': 'app.task.tasks.db_log.tasks.delete_db_opera_log',
|
|
'schedule': TzAwareCrontab('0', '0', day_of_week='6'),
|
|
},
|
|
'清理登录日志': {
|
|
'task': 'app.task.tasks.db_log.tasks.delete_db_login_log',
|
|
'schedule': TzAwareCrontab('0', '0', day_of_month='15'),
|
|
},
|
|
}
|