fix: add correct id to vertices_being_run and change condition to end traces (#2872)
* fix: add correct vertex id to vertices_being_run * fix: update condition for ending all traces in build_vertex function
This commit is contained in:
parent
9933e54274
commit
912683009f
2 changed files with 4 additions and 4 deletions
|
|
@ -258,7 +258,7 @@ async def build_vertex(
|
|||
if graph.stop_vertex and graph.stop_vertex in next_runnable_vertices:
|
||||
next_runnable_vertices = [graph.stop_vertex]
|
||||
|
||||
if not graph.run_manager.vertices_to_run and not next_runnable_vertices:
|
||||
if not graph.run_manager.vertices_being_run and not next_runnable_vertices:
|
||||
background_tasks.add_task(graph.end_all_traces)
|
||||
|
||||
build_response = VertexBuildResponse(
|
||||
|
|
|
|||
|
|
@ -998,11 +998,11 @@ class Graph:
|
|||
self.run_manager.remove_vertex_from_runnables(v_id)
|
||||
next_runnable_vertices = self.find_next_runnable_vertices(v_id, v_successors_ids)
|
||||
|
||||
for i in set(next_runnable_vertices): # Use set to avoid duplicates
|
||||
if i == v_id:
|
||||
for next_v_id in set(next_runnable_vertices): # Use set to avoid duplicates
|
||||
if next_v_id == v_id:
|
||||
next_runnable_vertices.remove(v_id)
|
||||
else:
|
||||
self.run_manager.add_to_vertices_being_run(v_id)
|
||||
self.run_manager.add_to_vertices_being_run(next_v_id)
|
||||
if cache:
|
||||
set_cache_coro = partial(get_chat_service().set_cache, key=self.flow_id)
|
||||
await set_cache_coro(self, lock)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue