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()