Merge branch 'feature/knowledge_lxc' into develop

This commit is contained in:
lixiangcheng1
2026-02-24 17:01:17 +08:00

View File

@@ -379,6 +379,9 @@ def build_graphrag_for_kb(kb_id: uuid.UUID):
) )
except Exception as e: except Exception as e:
print(f"{datetime.now().strftime('%H:%M:%S')} GraphRAG task failed for task {task}:\n{str(e)}\n") print(f"{datetime.now().strftime('%H:%M:%S')} GraphRAG task failed for task {task}:\n{str(e)}\n")
finally:
if db:
db.close()
print(f"{datetime.now().strftime('%H:%M:%S')} Knowledge Graph done ({time.time() - start_time}s)") print(f"{datetime.now().strftime('%H:%M:%S')} Knowledge Graph done ({time.time() - start_time}s)")
result = f"build knowledge graph '{db_knowledge.name}' processed successfully." result = f"build knowledge graph '{db_knowledge.name}' processed successfully."
@@ -389,6 +392,7 @@ def build_graphrag_for_kb(kb_id: uuid.UUID):
result = f"build knowledge grap '{db_knowledge.name}' failed." result = f"build knowledge grap '{db_knowledge.name}' failed."
return result return result
finally: finally:
if db:
db.close() db.close()