forked from 0xWheatyz/SPARC
Fix get_db_client() in auth.py to use a shared pooled database connection #95
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 newDatabaseClientinstance on every call. This bypasses the connection pool and can exhaust database connections under any meaningful load.Work
auth.pyto use the application-level sharedDatabaseClientinstance (the same one used by the rest of the API).get_db_client()function to avoid confusion.Acceptance Criteria
DatabaseClientis instantiated per-request in auth routes.References
Roadmap: P1 — Error handling and resilience — get_db_client() creates a new DatabaseClient on every call.