fix(dashboard): run GET /api/sessions session-DB read off the event loop

Flip the handler from async def to sync def so FastAPI executes it in
its threadpool: the SessionDB open + list_sessions_rich query no longer
block the single uvicorn event loop.

Residual hunk from PR #53966 — that PR's get_profiles_sessions flip
already landed via #54523/1bb7b59c5, and its get_status offload is
superseded by #58238's read_only + timeout variant in this branch.

(cherry picked from commit 414c12a40d)
This commit is contained in:
0-CYBERDYNE-SYSTEMS-0 2026-07-08 17:32:19 +05:30 committed by kshitij
parent d7e4d94e2f
commit 24d5bda1ef

View file

@ -3830,7 +3830,7 @@ async def get_action_status(name: str, lines: int = 200):
@app.get("/api/sessions") @app.get("/api/sessions")
async def get_sessions( def get_sessions(
limit: int = 20, limit: int = 20,
offset: int = 0, offset: int = 0,
min_messages: int = 0, min_messages: int = 0,