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)
| 163 | |
| 164 | |
| 165 | def _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 | |
| 185 | class _nulldict(dict): |
no test coverage detected