Skip to content

Commit

Permalink
fix: tolerate exceptions in cleaning up index when vector db service …
Browse files Browse the repository at this point in the history
…unavailable (langgenius#2533)
  • Loading branch information
bowenliang123 authored Feb 23, 2024
1 parent 12257b4 commit e421752
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/tasks/remove_document_from_index_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
index_node_ids = [segment.index_node_id for segment in segments]
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()
logging.info(
Expand Down

0 comments on commit e421752

Please sign in to comment.