MCPcopy
hub / github.com/celery/celery / _create_fake_task_request

Function _create_fake_task_request

celery/backends/base.py:80–92  ·  view source on GitHub ↗

Create a fake task request context for error callbacks. This helper reduces code duplication when creating fake request contexts for error callback handling.

(task_id, errbacks=None, task_name='unknown', **extra)

Source from the content-addressed store, hash-verified

78
79
80def _create_fake_task_request(task_id, errbacks=None, task_name='unknown', **extra) -> Context:
81 """Create a fake task request context for error callbacks.
82
83 This helper reduces code duplication when creating fake request contexts
84 for error callback handling.
85 """
86 return Context({
87 "id": task_id,
88 "errbacks": errbacks or [],
89 "delivery_info": dict(),
90 "task": task_name,
91 **extra
92 })
93
94
95class _nulldict(dict):

Callers 3

Calls 1

ContextClass · 0.90

Tested by 1