celery beat schedule: run task instantly when start celery beat?

后端 未结 2 1695
耶瑟儿~
耶瑟儿~ 2021-02-14 01:43

If I create a celery beat schedule, using timedelta(days=1), the first task will be carried out after 24 hours, quote celery beat documentation:

2条回答
  •  没有蜡笔的小新
    2021-02-14 01:56

    The best idea is create an implementation which schedules the task itself after completing the task. Also, create an entrance lock so the task cannot be executed multiple times per moment. Trigger the execution once.

    In this case,

    • you don't need a celerybeat process
    • the task is guaranteed to execute

提交回复
热议问题