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: http://docs.celeryproject.org/en/master/django/first-steps-with-django.html

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()
False

# 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?

+3


source to share


1 answer


Do you have a properly configured backend? http://docs.celeryproject.org/en/master/userguide/configuration.html#task-result-backend-settings



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

+4


source







All Articles