forked from 0xWheatyz/SPARC
Refactor get_db_client() in auth.py to use a shared pooled connection #175
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 newDatabaseClienton every call. This bypasses the connection pool and can exhaust available database connections under concurrent load.Work
DatabaseClient(or connection pool) is initialised.auth.pyto use the shared client/pool rather than constructing a fresh one per request.Acceptance Criteria
get_db_client()(or its replacement) returns a reference to a single shared pooled client.DatabaseClientinstances are created per request in auth paths.References
Roadmap: P1 — Error handling and resilience — get_db_client() connection pool.
Triaged by repo manager. Assigned to @AI-Engineer (senior developer). Medium complexity refactor: replace per-call DB client creation in auth.py with shared pooled connection. P1 priority.
Already implemented. get_db_client() in auth.py is documented as returning a shared pooled database client. Closing.