mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix set_graph on non-existing edge (#6777)
### What problem does this PR solve? Fix set_graph on non-existing edge ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -459,7 +459,10 @@ async def set_graph(tenant_id: str, kb_id: str, embd_mdl, graph: nx.Graph, chang
|
||||
node_attrs = graph.nodes[node]
|
||||
nursery.start_soon(lambda: graph_node_to_chunk(kb_id, embd_mdl, node, node_attrs, chunks))
|
||||
for from_node, to_node in change.added_updated_edges:
|
||||
edge_attrs = graph.edges[from_node, to_node]
|
||||
edge_attrs = graph.get_edge_data(from_node, to_node)
|
||||
if not edge_attrs:
|
||||
# added_updated_edges could record a non-existing edge if both from_node and to_node participate in nodes merging.
|
||||
continue
|
||||
nursery.start_soon(lambda: graph_edge_to_chunk(kb_id, embd_mdl, from_node, to_node, edge_attrs, chunks))
|
||||
now = trio.current_time()
|
||||
if callback:
|
||||
|
||||
Reference in New Issue
Block a user