Limit neighbor nodes fetch to 1000 in Neo4JStorage.

This commit is contained in:
yangdx
2025-03-08 11:29:08 +08:00
parent 887f6ed81a
commit 22a93fb717

View File

@@ -843,7 +843,7 @@ class Neo4JStorage(BaseGraphStorage):
results = await session.run(query, {"node_id": node.id}) results = await session.run(query, {"node_id": node.id})
# Get all records and release database connection # Get all records and release database connection
records = await results.fetch() records = await results.fetch(1000) # Max neighbour nodes we can handled
await results.consume() # Ensure results are consumed await results.consume() # Ensure results are consumed
# Nodes not connected to start node need to check degree # Nodes not connected to start node need to check degree