A
A
abbrakadabbra2019-02-21 18:01:29
Django
abbrakadabbra, 2019-02-21 18:01:29

Where is the Celery task state stored?

The task is to launch asynchronous task execution for the report, and then on the client side (front-end), poll the result of the task execution at intervals (otherwise the http request goes into timeout if you wait for the result directly in the view).
Celery works in conjunction with redis.
Question: how and where to get the state of the task from another view (which I will access at intervals via AJAX from the client) and, if successful, return the generated report to it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2019-02-21
@alternativshik

task.AsyncResult(task.request.id).state
docs.celeryproject.org/en/latest/reference/celery....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question