How can I schedule a Task to execute at a specific time using celery?

后端 未结 5 1571
忘掉有多难
忘掉有多难 2020-11-29 02:32

I\'ve looked into PeriodicTask, but the examples only cover making it recur. I\'m looking for something more like cron\'s ability to say \"execute

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 03:19

    While @asksol's answer still holds, the api has been updated. For celery 4.1.0, I have to import crontab and periodic_task as follows:

    from celery.schedules import crontab
    from celery.task import periodic_task
    

提交回复
热议问题