NestJS · Junior · Question 64 of 75
What must you call so that shutdown hooks run on SIGTERM?
- 1
process.exit()in each service - ✓Correct answer:
app.enableShutdownHooks() - 3
app.listen()handles it automatically
Explanation
Then onModuleDestroy and onApplicationShutdown can close database connections and finish work gracefully.