PrismaService implements OnModuleDestroy to call $disconnect(), but Nest only invokes module-destroy lifecycle hooks on SIGTERM/SIGINT if app.enableShutdownHooks() was called during bootstrap. Without it, the process exits without draining Postgres connections cleanly on container restarts/deploys.
Suggested fix: Add app.enableShutdownHooks(); in bootstrap(), before app.listen(...).
PrismaServiceimplementsOnModuleDestroyto call$disconnect(), but Nest only invokes module-destroy lifecycle hooks onSIGTERM/SIGINTifapp.enableShutdownHooks()was called during bootstrap. Without it, the process exits without draining Postgres connections cleanly on container restarts/deploys.Suggested fix: Add
app.enableShutdownHooks();inbootstrap(), beforeapp.listen(...).