Getting task_id inside a Celery task

后端 未结 3 354
夕颜
夕颜 2021-01-04 05:48

This is probably a stupid question but its got me stumped coming from a Ruby background.

I have an object that looks like this when I try to print it.



        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-04 06:24

    Short story, within function scan, use scan.request.id.

    See http://docs.celeryproject.org/en/latest/userguide/tasks.html?highlight=request#task-request-info

提交回复
热议问题