gpt4 book ai didi

celery - 收到类型的未注册任务

转载 作者:行者123 更新时间:2023-12-03 17:55:29 24 4
gpt4 key购买 nike

我正在尝试运行内存中的任务。
在 worker 上注册的任务

[2012-09-13 11:10:18,928: WARNING/PoolWorker-1] [u'B.run', u'M1.run', u'M11.run', u'M22.run', u'M23.run', u'M24.run', u'M25.run', u'M26.run', u'M4.run', u'celery.backend_cleanup', u'celery.chain', u'celery.chord', u'celery.chord_unlock', u'celery.chunks', u'celery.group', u'celery.map', u'celery.starmap', u'impmod.run', u'initializerNew.run']

但它仍然给出错误:
[2012-09-13 11:19:59,848: ERROR/MainProcess] Received unregistered task of type 'M24.run'.
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:
{'retries': 0, 'task': 'M24.run', 'eta': None, 'args': [{'cnt': '3', 'ids': '0001-0004,0002-0004', 'NagID': 2, 'wgt': '3', 'ModID': 'M24', 'ProfileModuleID': 64, 'mhs': '1'}, 0], 'expires': None, 'callbacks': None, 'errbacks': None, 'kwargs': {}, 'id': 'ddf5f520-803b-4dc9-ad3b-a931d90950a6', 'utc': True} (394b)

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery-3.0.4-py2.7.egg/celery/worker/consumer.py", line 410, in on_task_received
strategies[name](message, body, message.ack_log_error)
KeyError: 'M24.run'

最佳答案

你能附上启动 celery 的命令吗?看起来这个应用程序有不同的 sys.path,这就是 celery 应用程序无法导入“M24.run”任务的原因。

您还应该记住,Celery 需要在您的任务所在的位置设置模块名称。

类似的东西

CELERY_INCLUDE = [
'M24',
]

关于celery - 收到类型的未注册任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12400178/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com