NestJS · Middle · Question 58 of 75
How do you enable graceful shutdown with health checks in Kubernetes for Nest?
- ✓Correct answer: Call
app.enableShutdownHooks(), mark the app not ready on shutdown, and expose readiness/liveness via Terminus - 2Disable
SIGTERM - 3Nothing; Nest handles it automatically
Explanation
Close connections in onModuleDestroy or onApplicationShutdown, and give in-flight requests time to finish.