Reputation: 78254
I am sending a task like the below.....
from celery import Celery
celery = Celery()
celery.send_task('order_celery.order_worker', (order,))
From the worker log..this is what I get....
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery-3.1.7-py2.7.egg/celery/worker/consumer.py", line 445, in on_task_received
strategies[name](message, body,
KeyError: 'order_celery.order_worker'
here is my worker order_celery.py
from celery import Celery
app = Celery('tasks', broker='redis://%s:6379/0'%redis_host,backend='redis://%s:6379/0'%redis_host)
@app.task
def order_worker(order):
return True
Why will celery not work?
Upvotes: 0
Views: 2687
Reputation: 11396
order_celery.py should be in your PYTHONPATH, you should run your worker in like this:
celery -A order_worker worker --loglevel=info
Upvotes: 1