I\'ve been trying to follow the Celery First Steps With Celery and Next Steps guides. My setup is Windows 7 64-bit, Anaconda Python 2.7 (32-bit), Installed Erlang 32-bit bi
You must add track_started=True
. Well, it's hard to know this option.
The default value is False, so you will always get PENDING when the task is not finished. Besides, you must config wrong on backend or broker. Plz check them again.
@app.task(bind=True, track_started=True)
def add(x, y):
return x + y
.delay methods puts your task in queue. "result.state" is showing pending, which means your task in not yet executed. There might be a lot tasks, so its getting delayed.
Check if there are any tasks running
>>> from celery.task.control import inspect
>>> i = inspect()
>>> i.scheduled()
>>> i.active()
Randomly stopped working too. Exact same problem - forever pending. Reinstalling Erlang or RabbitMQ didn't help.
I tested also on Debian Linux 7 x86 and here it's working fine without problems.
Also: https://github.com/celery/celery/issues/2146
It's propably Windows related problem and setting worker flag --pool=solo fixed it for me ATM