fix: list_collections 异常向上传播而非静默吞掉

This commit is contained in:
2026-07-10 15:28:03 +08:00
parent 3308636086
commit 2e95f68864
4 changed files with 9 additions and 8 deletions
+2 -5
View File
@@ -54,11 +54,8 @@ class AppState:
def list_collections_with_stats(self) -> list[dict]:
"""列出所有 collection 及其统计(直接从 ChromaDB 查询)."""
result = []
try:
for coll in self.db.list_collections():
result.append({"name": coll.name, "count": coll.count()})
except Exception:
logger.exception("列出集合失败")
for coll in self.db.list_collections():
result.append({"name": coll.name, "count": coll.count()})
return result
def is_healthy(self) -> dict: