Skip to content

Commit

Permalink
fix(ordering): correctly remove vertex from list of runnable vertices (
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz committed Jul 9, 2024
1 parent 1fae5ad commit eed48ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/backend/base/langflow/api/v1/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ async def retrieve_vertices_order(
first_layer = graph.sort_vertices()
else:
first_layer = graph.sort_vertices()
# When we send vertices to the frontend
# we need to remove them from the predecessors
# so they are not considered for building again
# which duplicates the results
for vertex_id in first_layer:
graph.remove_from_predecessors(vertex_id)
graph.remove_vertex_from_runnables(vertex_id)

# Now vertices is a list of lists
# We need to get the id of each vertex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def get_next_runnable_vertices(
"""
async with lock:
self.remove_from_predecessors(vertex.id)
self.remove_vertex_from_runnables(vertex.id)
direct_successors_ready = [
v for v in vertex.successors_ids if self.is_vertex_runnable(v, graph.inactivated_vertices)
]
Expand Down

0 comments on commit eed48ce

Please sign in to comment.