celery.beat的crontab实现 [英] celery.beat implementation of crontab
本文介绍了celery.beat的crontab实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的任务是在Wowza媒体服务器中添加一个新流,该流必须在用户指定的时间进行。目前,我为此目的将crontab和http provider一起使用。我想要一个 celery.beat
实现。有人可以帮忙吗?
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?
推荐答案
如果这是要在特定时间执行的一次性任务,则不需要
If this is a one-off task to be executed at a specific time then you don't need to use Periodic Tasks (celerybeat).
相反,您可以对 task.apply_async
使用eta / countdown参数:
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
这篇关于celery.beat的crontab实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文