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'
时的输出答案 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