小编And*_*Fry的帖子

celery worker 仅在未分离时导入任务

我正在尝试让我的 django 应用程序将任务提交给 celery 工作人员,并且当工作人员附加运行时它成功了。一旦我添加 --detach 任务就无法注册。

[2020-10-26 04:09:33,159: ERROR/MainProcess] Received unregistered task of type 'devapp.tasks.create_random_files'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
http://docs.celeryq.org/en/latest/internals/protocol.html
for more information.

The full contents of the message body was:
'[[20, "blah", 5120], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (93b)
Traceback (most recent call last):
  File "/pysite/project/venv/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 562, in on_task_received
    strategy = strategies[type_] …
Run Code Online (Sandbox Code Playgroud)

django rabbitmq celery django-celery

5
推荐指数
1
解决办法
263
查看次数

标签 统计

celery ×1

django ×1

django-celery ×1

rabbitmq ×1