【发布时间】:2014-04-28 15:03:33
【问题描述】:
我有一些周期性任务需要在每个月的第一天午夜运行,但需要在客户端的特定时区运行。我正在尝试将所有内容都保留为 UTC,所以我有
CELERY_ENABLE_UTC = True
因此,如果我有多个任务,每个任务都需要在特定时区的午夜运行,那么使用 Celery 执行此操作的最干净的方法是什么?例如,在各自的时区午夜运行这 2 个任务?
#for Client 1, this needs to run at Midnight EST (US/Eastern)
schedule1 = crontab(day_of_month=1,
hour = 0,
minute = 0
)
#for Client 2, this needs to run at Midnight PST (US/Pacific)
schedule1 = crontab(day_of_month=1,
hour = 0,
minute = 0
)
【问题讨论】: