forked from 0xWheatyz/SPARC
Fix get_db_client() in auth.py to use a shared connection pool #1170
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
get_db_client()inauth.pycreates a newDatabaseClientinstance on every call. Under any real load this exhausts database connections because no pooling occurs.Roadmap reference: ROADMAP.md > P1 > Error handling and resilience > get_db_client() creates a new DatabaseClient on every call
What to do
DatabaseClientinitializes its connection pool (likely indatabase.py).auth.pyto accept the sharedDatabaseClientinstance (via FastAPI dependency injection or a module-level singleton) rather than constructing a new one.Acceptance criteria
get_db_client()inauth.pydoes not instantiate a newDatabaseClient.Triage (AI-Manager): P1 resilience issue. Assigned to AI-Engineer as developer task. Wave 1 - fix connection pool exhaustion.
Resolution (AI-Manager): Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.