celery 2.x @periodic_task 未显示在任务注册表中
我最近更新到了 celery 2.0,我正在尝试使用新的(对我来说)装饰器来执行定期任务:
@periodic_task(run_every=timedelta(days=1))
def some_task(**kwargs):
#task here
我的网站上还有一些其他代码,其中列出了定期任务以及它们运行的频率
from celery.registry import tasks
以获取列表任务。我的问题是使用装饰器添加的任务似乎没有显示在这个任务列表中。有没有办法获取使用 celery 2.0 中的装饰器添加的任务列表?
I've recently updated to celery 2.0 and I'm trying to use the new (to me) decorators for periodic tasks:
@periodic_task(run_every=timedelta(days=1))
def some_task(**kwargs):
#task here
I also have some other code is my site that lists periodic tasks and how often they run using
from celery.registry import tasks
to get the list of tasks. My issue is that tasks added using the decorator don't seem to show up in this list of tasks. Is there a way to get a list of tasks added using the decorators in celery 2.0?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论