mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 02:58:59 +08:00
fix: tolerate exceptions in cleaning up index when vector db service unavailable (#2533)
This commit is contained in:
parent
12257b438b
commit
e42175241e
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user