Every module in src/ shares a single Prisma client via import db from '../db' — except two:
src/compliance/travelRule.ts: const prisma = new PrismaClient()
src/compliance/cases.ts: const prisma = new PrismaClient()
Each new PrismaClient() opens its own connection pool. Under PgBouncer/RDS connection limits this is a real resource leak (and it silently diverges from the connection-pool sizing the rest of the app relies on in src/db).
Task
- Replace both with
import db from '../db' and drop the local instantiation.
- Grep the rest of
src/ for any other new PrismaClient() to confirm these are the only two stragglers.
Good first issue — small, mechanical, but worth catching before it ships to production.
Every module in
src/shares a single Prisma client viaimport db from '../db'— except two:src/compliance/travelRule.ts:const prisma = new PrismaClient()src/compliance/cases.ts:const prisma = new PrismaClient()Each
new PrismaClient()opens its own connection pool. UnderPgBouncer/RDS connection limits this is a real resource leak (and it silently diverges from the connection-pool sizing the rest of the app relies on insrc/db).Task
import db from '../db'and drop the local instantiation.src/for any othernew PrismaClient()to confirm these are the only two stragglers.Good first issue — small, mechanical, but worth catching before it ships to production.