forked from 0xWheatyz/SPARC
Bug: Refactor get_db_client() in auth.py to use a shared connection pool #712
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?
Summary
get_db_client()inauth.pyinstantiates a newDatabaseClienton every call. This bypasses the connection pool and can exhaust database connections under load.What to do
DatabaseClientinstance is initialised in the application (likely indatabase.pyor app startup).get_db_client()to return the already-initialised singleton/pool instead of creating a new one.app.stateobject.Acceptance Criteria
get_db_client()does not callDatabaseClient()(or equivalent constructor) on every invocation.Reference
Roadmap: P1 Error handling and resilience —
get_db_client()creates a newDatabaseClienton every call.[Repo Manager] Already resolved. get_db_client() uses a module-level singleton _db_client with init/close at startup/shutdown.
Closing as already implemented in the codebase.