MCPcopy Create free account
hub / github.com/celery/celery / get_current_worker_task

Function get_current_worker_task

celery/_state.py:126–135  ·  view source on GitHub ↗

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``)

()

Source from the content-addressed store, hash-verified

124
125
126def 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.

Callers 1

current_worker_taskMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected