为什么不是芹菜后端指向不是本地主机不工作的IP?

时间:2016-07-08 17:43:38

标签: python rabbitmq task celery amqp

from celery import Celery

app = Celery('tasks', backend='amqp://guest@192.168.99.100', broker='amqp://guest@192.168.99.100//')


@app.task()
def add(x, y):
    return x + y

我成功地能够发送芹菜任务但是当我尝试获取任务的结果时它不会发送回来。我认为这是由于后端ip被设置为外部ip而芹菜不尊重它。

- ** ---------- .> transport:   amqp://guest:**@192.168.99.100:5672//
- ** ---------- .> results:     amqp://

以上是我运行'Celery -A workers.tasks worker --loglevel = debug'

时的输出

1 个答案:

答案 0 :(得分:0)

I don't know exactly why this worked but it did

Run the command with the --pool=threads/solo switch

Celery -A proj.tasks worker -l info --pool=threads -n w1