|
|
@@ -282,7 +282,7 @@ class KnowledgeBaseService:
|
|
|
milvus_names_set = set(milvus_service.client.list_collections())
|
|
|
for item in items:
|
|
|
# 父集合可能为空(未勾选创建父集合),此时只要子集合存在也算已同步
|
|
|
- c1_ok = True if not item.collection_name_parent else item.collection_name_parent in milvus_names_set
|
|
|
+ c1_ok = True if not getattr(item, "has_parent_collection", 1) else item.collection_name_parent in milvus_names_set
|
|
|
c2_ok = True
|
|
|
if item.collection_name_children:
|
|
|
c2_ok = item.collection_name_children in milvus_names_set
|
|
|
@@ -339,6 +339,7 @@ class KnowledgeBaseService:
|
|
|
name=payload.name,
|
|
|
collection_name_parent=parent_name,
|
|
|
collection_name_children=child_name,
|
|
|
+ has_parent_collection=1 if parent_name else 0,
|
|
|
description=payload.description,
|
|
|
# 默认创建为禁用状态,待同步成功后再启用
|
|
|
status="disabled",
|