From 7ff9239599b7d8789746bf6c0a923d442cd19e84 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 21 May 2026 00:12:27 +0800 Subject: [PATCH] auto-sync: 2026-05-21 00:12:27 --- src/api/project_routes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/project_routes.py b/src/api/project_routes.py index 098b0c3..234bedc 100644 --- a/src/api/project_routes.py +++ b/src/api/project_routes.py @@ -30,8 +30,10 @@ async def list_projects(): db_path = Path(reg.root) / pid / "blackboard.db" if db_path.exists(): try: - bb = Blackboard(db_path) - info['task_count'] = bb.count_tasks() + conn = sqlite3.connect(str(db_path), timeout=5) + count = conn.execute("SELECT COUNT(*) FROM tasks").fetchone()[0] + conn.close() + info['task_count'] = count except Exception: pass return {"projects": {pid: info for pid, info in projects.items()