Cancels all open tasks in the workflow. Args: success (bool): the state of the workflow Returns: list(`Task`): the cancelled tasks
(self, success=False)
| 204 | task.task_spec._update(task) |
| 205 | |
| 206 | def cancel(self, success=False): |
| 207 | """Cancels all open tasks in the workflow. |
| 208 | |
| 209 | Args: |
| 210 | success (bool): the state of the workflow |
| 211 | |
| 212 | Returns: |
| 213 | list(`Task`): the cancelled tasks |
| 214 | """ |
| 215 | self.success = success |
| 216 | self.completed = True |
| 217 | logger.info(f'Workflow cancelled', extra=self.collect_log_extras()) |
| 218 | cancelled = [] |
| 219 | for task in TaskIterator(self.task_tree, state=TaskState.NOT_FINISHED_MASK): |
| 220 | cancelled.append(task) |
| 221 | for task in cancelled: |
| 222 | task.cancel() |
| 223 | return cancelled |
| 224 | |
| 225 | def set_data(self, **kwargs): |
| 226 | """Defines the given attribute/value pairs.""" |
nothing calls this directly
no test coverage detected