Created
June 7, 2017 17:00
-
-
Save jayapal/2af114fb319798487d541ed1990848a0 to your computer and use it in GitHub Desktop.
how to get celery task state or status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def hello(): | |
print "hello world" | |
task = hello.delay() | |
task_id = task.id | |
from celery.result import AsyncResult | |
state = AsyncResult(task_id).state | |
print state # you can get the task status | |
#http://docs.celeryproject.org/en/latest/reference/celery.states.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment