Преглед изворни кода

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

tags/0.5.7
Bowen Liang пре 1 година
родитељ
комит
e42175241e
No account linked to committer's email address
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4
    1
      api/tasks/remove_document_from_index_task.py

+ 4
- 1
api/tasks/remove_document_from_index_task.py Прегледај датотеку

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(

Loading…
Откажи
Сачувај