Reputation: 1270
How can I get the task id from the tasks.py in celery
from __future__ import absolute_import
from pig_engine.celery import app
import time
@app.task
def run(code):
result = task_id /// How to get the task id
return result
I know we can get the task id from run.delay().id , but how can get same id in tasks it self
Upvotes: 2
Views: 5002