Currently executing task, that was applied by the worker. This is used to differentiate between the actual task executed by the worker and any task that was called within a task (using ``task.__call__`` or ``task.apply``)
()
| 124 | |
| 125 | |
| 126 | def get_current_worker_task(): |
| 127 | """Currently executing task, that was applied by the worker. |
| 128 | |
| 129 | This is used to differentiate between the actual task |
| 130 | executed by the worker and any task that was called within |
| 131 | a task (using ``task.__call__`` or ``task.apply``) |
| 132 | """ |
| 133 | for task in reversed(_task_stack.stack): |
| 134 | if not task.request.called_directly: |
| 135 | return task |
| 136 | |
| 137 | |
| 138 | #: Proxy to current app. |