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

Function _result_errbacks

celery/backends/base.py:165–182  ·  view source on GitHub ↗

Return the id of the result of ``sig`` and the errbacks linked to it. A chord's result is that of its body, which the chord's own errbacks are linked to when it runs. For a group, the errbacks of its tasks are collected along with its own; for a chain, only its own. The ids are thos

(sig, app)

Source from the content-addressed store, hash-verified

163
164
165def _result_errbacks(sig, app):
166 """Return the id of the result of ``sig`` and the errbacks linked to it.
167
168 A chord's result is that of its body, which the chord's own errbacks
169 are linked to when it runs. For a group, the errbacks of its tasks are
170 collected along with its own; for a chain, only its own. The ids are
171 those given by freezing.
172 """
173 sig = maybe_signature(sig, app=app)
174 errbacks = []
175 while isinstance(sig, chord) and sig.body is not None:
176 errbacks.extend(maybe_list(sig.options.get("link_error")) or [])
177 sig = maybe_signature(sig.body, app=app)
178 errbacks.extend(maybe_list(sig.options.get("link_error")) or [])
179 if isinstance(sig, group):
180 for task in sig.tasks:
181 errbacks.extend(_result_errbacks(task, app)[1])
182 return sig.options.get("task_id"), errbacks
183
184
185class _nulldict(dict):

Callers 1

Calls 4

maybe_signatureFunction · 0.90
maybe_listFunction · 0.85
extendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected