NestJS · Senior · Question 66 of 75
What does onApplicationShutdown(signal) receive and why is it useful?
- 1The last HTTP request
- 2The list of errors since start
- ✓Correct answer: The signal that triggered shutdown (e.g.
SIGTERM), so you can log it and adjust cleanup
Explanation
It runs after connections are closed by the HTTP server, as the last chance to flush logs or metrics.