TypeScript · medium
getClient() opens a new connection on every call. The pool reached 400 before lunch, even though callers should be able to share one client.
Reuse one client across calls. Two results from getClient() must be the same object reference, so the pool does not keep growing.
workspace/
└── src/
└── db.ts (new client every call; pool crying)With sharpen installed, this command opens exactly this challenge in your local arena:
sharpen 31
First time? The full install is right below.
npm install -g @juanwmedia/sharpen sharpen 31 npx @juanwmedia/sharpen 31 sharpen update