celery.beat implementation of crontab

旧时模样 提交于 2019-12-02 19:14:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!