Use get_task_executions_count for any_cancels method

To get the result we need only a number of tasks, so there is no
need to fetch full task executions from the database.

Change-Id: I34ea985e6de08f46e1c40c64996357c8e6f3d79c
This commit is contained in:
Mike Fedosin
2019-06-06 15:46:34 +02:00
parent 55c7990684
commit 15355ea5e1

View File

@@ -202,7 +202,10 @@ class WorkflowController(object):
:return: True if there is one or more tasks in cancelled state.
"""
return len(self._get_task_executions(state=states.CANCELLED)) > 0
return db_api.get_task_executions_count(
workflow_execution_id=self.wf_ex.id,
state=states.CANCELLED
) > 0
@abc.abstractmethod
def evaluate_workflow_final_context(self):