0

I am new to Celery and Django. I got the task id using

task_id = task.request.id

but not able to get the task state.

Any suggestion to get the task state? Any help would be appreciated. Thanks!

1 Answer 1

1

I got the status of task as below

task.py

from celery.result import AsyncResult

result = task_name.AsyncResult(task_name.request.id)
taskStatus = result.state

celeryconfig.py

CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
CELERY_IGNORE_RESULT = False
CELERY_TRACK_STARTED = True
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.