收到未注册的芹菜任务 [英] Received unregistered task for celery

查看:82
本文介绍了收到未注册的芹菜任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行工作者从队列中接收作业时,出现未注册错误.这就是我正在做的

I am getting unregistered error when i run the worker to take jobs from a queue. This is how i am doing

芹菜-任务胜过

以上命令将在特定时间安排作业.之后,该任务将被添加到默认队列中.现在,我在其他终端上以如下方式运行celery worker

The above command will schedule a job at specific time. After that, the task will be added to default queue.Now i run celery worker in other terminal as below

芹菜工人-Q默认值

celery worker -Q default

但是我遇到了以下错误

[2014-08-19 19:34:02,466: ERROR/MainProcess] Received unregistered task of type 'TasksReg.vodafone_v2'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you are using relative imports?
Please see http://bit.ly/gLye1c for more information.

The full contents of the message body was:
{'utc': False, 'chord': None, 'args': [[u'Kerala,Karnataka']], 'retries': 0, 'expires': None, 'task': 'TasksReg.vodafone_v2', 'callbacks': None, 'errbacks': None, 'timelimit': (None, None), 'taskset': None, 'kwargs': {}, 'eta': None, 'id': 'd4390336-9110-4e47-9e3a-017017cb509c'} (244b)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 455, in on_task_received
    strategies[name](message, body,
KeyError: 'TasksReg.vodafone_v2'

推荐答案

您应该确保定义任务 vodafone_v2 的模块已由芹菜工作者加载.

You should make sure the module that defines the task vodafone_v2 gets loaded by the celery worker.

如果遵循建议的模块结构布局,通常可以通过任务自动发现免费获得它.

You normally get that for free via task autodiscovery if you follow the suggested structure layout of your modules.

我想这是行不通的,因为您启动了没有 -A Tasks 参数的工作程序.

I guess this is not working because you start the worker without the -A Tasks parameter.

也许您可以尝试

芹菜-A Tasks worker -Q默认-l info

这篇关于收到未注册的芹菜任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆