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 414c12a40db07b941b0c589674bc6aad3f090ff7)
fix/verification-admin-route-recovery
0-CYBERDYNE-SYSTEMS-0 2026-07-08 17:32:19 +05:30 committed by kshitij
parent d7e4d94e2f
commit 24d5bda1ef
1 changed files with 1 additions and 1 deletions

View File

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