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

后端 未结 5 1582
忘掉有多难
忘掉有多难 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

    Use

    YourTask.apply_async(args=[some, args, here], eta=when)
    

    And at the end of your task, reschedule it to the next time it should run.

提交回复
热议问题