How to set task id in celery


distributed system

Here’s a convenient way to set task id in celery:

import uuid # in-built in Python
task_id = str(uuid.uuid1())
task_dosomething.apply_async(task_id=task_id) 

task_dosomething is your task function name.

Works on windows 8

Free Flask Course