ILifecycleApi.onShutdown(fn: () => void | Promise<void>): void
Runs when shutdown begins — close connections, flush buffers here.
By this point the application is already refusing new requests and the
server socket is closed; use onStopping for work that must
happen while traffic is still being served.