Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
365 views
in Technique[技术] by (71.8m points)

python - 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."

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...