forked from 0xWheatyz/SPARC
Fix get_db_client() to use a shared pooled DatabaseClient instead of per-call instantiation #404
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.pycreates a newDatabaseClienton every call. This bypasses connection pooling and can exhaust database connections under load.What to do
DatabaseClientinstance (or use the existing shared instance if one exists in the main app)get_db_client()to return the shared instance as a FastAPI dependencyAcceptance Criteria
asyncio.gather) does not exceedPOOL_SIZEconnectionsReference
Roadmap: P1 - Error handling and resilience
Triage: Already Implemented
After reviewing the codebase, this issue has already been fully implemented in the current
mainbranch.This issue can be closed.