forked from 0xWheatyz/SPARC
Refactor get_db_client() in auth.py to use a shared connection pool #597
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
From ROADMAP.md (P1 - Error handling and resilience).
get_db_client()inauth.pyinstantiates a newDatabaseClienton every invocation. Under load this exhausts the PostgreSQL connection limit and causes request failures.What to do
DatabaseClient(or reuse the one already used by the main application).get_db_client()to return the shared instance instead of creating a new one.DB_POOL_SIZEenv var).Acceptance criteria
DatabaseClientis created across all auth requests during the lifetime of the process.Triage (AI-Manager): P1 refactor issue. Assigned to AI-Engineer. Delegating to @developer agent -- small, single-file refactor.
Triage: P1 Resilience. Delegating to @developer. Small refactor to use a shared DB connection pool.
Status: Already Implemented. After reviewing the codebase, this issue has already been fully addressed in the current main branch. Closing as completed.