fix: 移除 collection.flush() Fixes #297
This commit is contained in:
parent
7c40d6c421
commit
c33d56f078
@ -263,11 +263,10 @@ class MilvusKB(KnowledgeBase):
|
|||||||
embeddings,
|
embeddings,
|
||||||
]
|
]
|
||||||
|
|
||||||
def _insert_and_flush():
|
def _insert_records():
|
||||||
collection.insert(entities)
|
collection.insert(entities)
|
||||||
collection.flush()
|
|
||||||
|
|
||||||
await asyncio.to_thread(_insert_and_flush)
|
await asyncio.to_thread(_insert_records)
|
||||||
|
|
||||||
logger.info(f"Inserted {content_type} {item} into Milvus. Done.")
|
logger.info(f"Inserted {content_type} {item} into Milvus. Done.")
|
||||||
|
|
||||||
@ -363,7 +362,6 @@ class MilvusKB(KnowledgeBase):
|
|||||||
def _delete_from_milvus():
|
def _delete_from_milvus():
|
||||||
try:
|
try:
|
||||||
collection.delete(expr)
|
collection.delete(expr)
|
||||||
collection.flush()
|
|
||||||
logger.info(f"Deleted chunks for file {file_id} from Milvus")
|
logger.info(f"Deleted chunks for file {file_id} from Milvus")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error deleting file {file_id} from Milvus: {e}")
|
logger.error(f"Error deleting file {file_id} from Milvus: {e}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user