forked from 0xWheatyz/SPARC
Bug: refactor get_db_client() in auth.py to use a shared connection pool #246
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?
Background
get_db_client()inauth.pycreates a newDatabaseClienton every call. This bypasses the connection pool and can exhaust database connections under load.Task
DatabaseClientis initialized elsewhere in the codebase (likely indatabase.pyormain.py)auth.pyto obtain the database client from the application lifespan / dependency injection rather than instantiating a new one per callDependsor app state)Acceptance Criteria
get_db_client()no longer creates a freshDatabaseClienton every invocationReference
Roadmap: P1 Error handling and resilience — DatabaseClient per-call in auth.py
Triage: P1/medium - Assigned to @senior-developer. Requires understanding of FastAPI DI patterns and connection pool management. Wave 2.
This issue has been verified as already resolved in the current codebase. All acceptance criteria are met. Closing.