Celtrix
Celtrix copied to clipboard
[FEATURE] Close the server and database connection gracefully in the generated API
Description
The generated API in apps/api does not appear to handle shutdown signals (please verify), so Ctrl+C or a container stop can leave database connections open.
Proposed solution
- Handle SIGINT and SIGTERM: stop accepting requests, disconnect Prisma or Mongoose, then exit 0
- Force exit after a short timeout
- Cover Express, Hono, Fastify, and the Bun runtime
Acceptance criteria
- [ ] Stopping
npm run devleaves no open database connections - [ ] Exit code is 0 on a clean shutdown
- [ ] The e2e test checks shutdown
Please assign me !.
Hello Pratik Damas, Could you please assign this issue to me? I can work on it and resolve it.