Fix should_run_vertex method to remove vertex_id from vertices_to_run list

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-03 19:03:41 -03:00
commit 3985236224
2 changed files with 5 additions and 1 deletions

View file

@ -128,6 +128,7 @@ async def build_vertex(
next_vertices_ids = [
v for v in next_vertices_ids if graph.should_run_vertex(v)
]
result_data_response = ResultDataResponse(**result_dict.model_dump())
except Exception as exc:

View file

@ -787,7 +787,10 @@ class Graph:
def should_run_vertex(self, vertex_id: str) -> bool:
"""Returns whether a component should be run."""
return vertex_id in self.vertices_to_run
should_run = vertex_id in self.vertices_to_run
if should_run:
self.vertices_to_run.remove(vertex_id)
return should_run
def sort_interface_components_first(
self, vertices_layers: List[List[str]]