Django celery always returns false while checking if data is ready

I have Django installed with Celery running rabbitmq.

The following example was implemented in my project:

When I run a simple test in two terminal windows, the results look like this:

# Terminal 1
>>> from Exercise.tasks import *
>>> result = add.delay(2,3)
>>> result
<AsyncResult: e6c92297-eea2-4f99-8902-1446ac74a6bb>
>>> result.ready()

# Terminal 2
$ celery -A Website3 worker -l info
[2014-10-02 14:39:59,269: INFO/MainProcess] Received task: Exercise.tasks.add[464249dd-ab89-4099-badd-9190a147310f]
[2014-10-02 14:39:59,271: INFO/MainProcess] Task Exercise.tasks.add[464249dd-ab89-4099-badd-9190a147310f] succeeded in 0.0010875929147s: 5


Obviously the data is complete, but I cannot get this data.

What am I doing wrong here?


source to share

1 answer

Do you have a properly configured backend?

Celery needs to be properly configured to store the state and results of asynchronous tasks.



All Articles