修复当出现异常时,会导致更新数据卡死的bug

This commit is contained in:
Magic_yuan
2025-01-24 10:15:25 +08:00
parent 63bd066307
commit 443aab2882

View File

@@ -469,9 +469,8 @@ class LightRAG:
error_msg = f"Failed to process document {doc_id}: {str(e)}\n{traceback.format_exc()}" error_msg = f"Failed to process document {doc_id}: {str(e)}\n{traceback.format_exc()}"
logger.error(error_msg) logger.error(error_msg)
continue continue
else:
finally: # Only update index when processing succeeds
# Ensure all indexes are updated after each document
await self._insert_done() await self._insert_done()
def insert_custom_chunks(self, full_text: str, text_chunks: list[str]): def insert_custom_chunks(self, full_text: str, text_chunks: list[str]):