问题
My task is to add a new stream in Wowza media server which must take place at a user specified time. Currently I'm using crontab together with http provider for this purpose. I want a celery.beat
implementation for this. Can anyone help?
回答1:
If this is a one-off task to be executed at a specific time then you don't need to use Periodic Tasks (celerybeat).
Rather you can use the eta/countdown argument to task.apply_async
:
task.apply_async(eta=datetime(2012, 07, 1, 14, 30))
task.apply_async(countdown=30) # in 30 seconds
Read more here:
http://celery.github.com/celery/userguide/calling.html
来源:https://stackoverflow.com/questions/11237536/celery-beat-implementation-of-crontab