Files
task-executer/scheduler.py
2025-12-09 15:16:37 +08:00

11 lines
327 B
Python

from celery.schedules import crontab
from celery_app import app
# 使用crontab设置精确的定时任务
app.conf.beat_schedule = {
'daily-morning-9am': {
'task': 'tasks.daily_morning_task',
'schedule': crontab(hour=9, minute=0), # 每天上午9点执行
'options': {'queue': 'default'}
},
}