修改问题

This commit is contained in:
strepsiades
2026-04-01 17:04:26 +08:00
parent 7c49df94fc
commit 9a3a34c58b
10 changed files with 119 additions and 29 deletions
+8
View File
@@ -78,6 +78,14 @@ class DataCollection:
# node_id 不变但 data_id 变更,清理旧索引
self._data_id_to_node_id.pop(old_node.data_id, None)
stale_data_ids = [
data_id
for data_id, existing_node_id in self._data_id_to_node_id.items()
if existing_node_id == node.node_id and data_id != node.data_id
]
for stale_data_id in stale_data_ids:
self._data_id_to_node_id.pop(stale_data_id, None)
if node.data_id and node.data_id != "":
existing_node_id = self._data_id_to_node_id.get(node.data_id)
if existing_node_id is not None and existing_node_id != node.node_id: