8000 Avoid calling graph.in_cycle() if possible by panos-gkonis · Pull Request #273 · StackStorm/orquesta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Avoid calling graph.in_cycle() if possible #273

New issue

Have a question about this project? Sign up for a free GitHub 8000 account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions orquesta/conducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,9 +1107,8 @@ def _evaluate_route(self, task_transition, prev_route):
)

is_split_task = self.spec.tasks.is_split_task(task_id)
is_in_cycle = self.graph.in_cycle(task_id)

if not is_split_task or is_in_cycle:
if not is_split_task:
return prev_route

old_route_details = self.workflow_state.routes[prev_route]
Expand All @@ -1121,6 +1120,11 @@ def _evaluate_route(self, task_transition, prev_route):
if old_route_details == new_route_details:
return prev_route

# The following is very computationally expensive; defer it as much as possible.
is_in_cycle = self.graph.in_cycle(task_id)
if is_in_cycle:
return prev_route

self.workflow_state.routes.append(new_route_details)

return len(self.workflow_state.routes) - 1
Expand Down
0