'Celery - Pass task info to the task_postrun-connect signal

I have a usecase where in the @task_postrun.connect signal I need to do some handling based on a condition. The problem is I get to know the condition result only when the celery task executes. Now the question is how can pass that condition value to the postrun signal from inside of the task.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source