Skip to content

Instantly share code, notes, and snippets.

@jayapal
Created June 7, 2017 17:00
Show Gist options
  • Save jayapal/2af114fb319798487d541ed1990848a0 to your computer and use it in GitHub Desktop.
Save jayapal/2af114fb319798487d541ed1990848a0 to your computer and use it in GitHub Desktop.
how to get celery task state or status
@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