Merge "Prepare cache for _is_upstream_task_execution"

This commit is contained in:
Zuul 2019-06-04 13:27:44 +00:00 committed by Gerrit Code Review
commit a05ee2af0f
1 changed files with 10 additions and 1 deletions

View File

@ -58,11 +58,20 @@ class DirectWorkflowController(base.WorkflowController):
if not t_spec.get_join():
return t_ex_candidate.processed
names = self._find_all_parent_task_names(t_spec)
t_execs_cache = {
t_ex.name: t_ex for t_ex in self._get_task_executions(
fields=('id', 'name', 'state'),
name={'in': names}
)
} if names else {} # don't perform a db request if 'names' are empty
induced_state, _, _ = self._get_induced_join_state(
self.wf_spec.get_tasks()[t_ex_candidate.name],
t_ex_candidate,
t_spec,
{}
t_execs_cache
)
return induced_state == states.RUNNING