Remove _find_task_execution_by_name

This method was used to find a task execution by its name in
_is_upstream_task_execution only. But this operation can be
simplified, because we already have the task execution,
and therefore there is no need to search for it again in the
database.

Change-Id: I45a175970bc2567f5ef63e161fa431c8e9245ec1
This commit is contained in:
Mike Fedosin 2019-06-02 23:03:14 +02:00
parent e25da33607
commit cd19e48697
1 changed files with 1 additions and 9 deletions

View File

@ -60,7 +60,7 @@ class DirectWorkflowController(base.WorkflowController):
induced_state, _, _ = self._get_induced_join_state(
self.wf_spec.get_tasks()[t_ex_candidate.name],
self._find_task_execution_by_name(t_ex_candidate.name),
t_ex_candidate,
t_spec,
{}
)
@ -501,14 +501,6 @@ class DirectWorkflowController(base.WorkflowController):
return states.RUNNING, 1, next_tasks_dict[join_task_name]
def _find_task_execution_by_name(self, t_name):
# Note: in case of 'join' completion check it's better to initialize
# the entire task_executions collection to avoid too many DB queries.
t_execs = self._get_task_executions(name=t_name)
# TODO(rakhmerov): Temporary hack. See the previous comment.
return t_execs[-1] if t_execs else None
def _possible_route(self, task_spec, t_execs_cache, depth=1):
in_task_specs = self.wf_spec.find_inbound_task_specs(task_spec)