I was looking through Grinberg’s tuto on celery and flask. I saw querying tasks by
task = long_task.AsyncResult(task_id)
But for some reasons it was not working for me. I looked at Flower’s get_task_by_id which led to wrapping a tornado object. It was too complicated for me to include Tornado in my project. I browsed through celery’s source and found the query_task function which led me to the _find_requests_by_id fucntion which led to a state file but i could not find it by inspecting my celery app. I finally found the right path and documented it under finding task by id in celery 5.1.2.
Works on windows 8
Written by
Abdur-Rahmaan Janhangeer
Chef
Python author of 7+ years having worked for Python companies around the world
Suggested Posts
How to query task by id in celery
Using celery 5.1.2 you can get the task id by the following code snippet: from celery import current...
How to set task id in celery
Here’s a convenient way to set task id in celery: import uuid # in-built in Python task_id = str(uui...
Python EFL: Building Custom Elementary Widgets (2026)
Want to create unique UI components tailored to your app’s needs? This Python EFL tutorial teaches y...