Unverified Commit e4217524 authored by Bowen Liang's avatar Bowen Liang Committed by GitHub

fix: tolerate exceptions in cleaning up index when vector db service unavailable (#2533)

parent 12257b43
...@@ -42,7 +42,10 @@ def remove_document_from_index_task(document_id: str): ...@@ -42,7 +42,10 @@ def remove_document_from_index_task(document_id: str):
segments = db.session.query(DocumentSegment).filter(DocumentSegment.document_id == document.id).all() segments = db.session.query(DocumentSegment).filter(DocumentSegment.document_id == document.id).all()
index_node_ids = [segment.index_node_id for segment in segments] index_node_ids = [segment.index_node_id for segment in segments]
if index_node_ids: if index_node_ids:
index_processor.clean(dataset, index_node_ids) try:
index_processor.clean(dataset, index_node_ids)
except Exception:
logging.exception(f"clean dataset {dataset.id} from index failed")
end_at = time.perf_counter() end_at = time.perf_counter()
logging.info( logging.info(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment