Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 this task every Monday at 1 a.m."

like image 629
Hank Gay Avatar asked Jan 02 '10 03:01

Hank Gay


1 Answers

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.

like image 77
nosklo Avatar answered Oct 13 '22 01:10

nosklo