forked from 0xWheatyz/SPARC
Fix DatabaseClient connection pooling in auth.py #801
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 newDatabaseClientinstance on every call. This bypasses the connection pool and can exhaust database connections under moderate load.What to do
get_db_client()to return a shared, module-level (or application-scoped)DatabaseClientinstanceAcceptance criteria
DatabaseClientinstance is shared across all auth requestsauth.pyReferences
Roadmap item: P1 Error handling and resilience --
get_db_client()creates a newDatabaseClienton every call