You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even if I hook to the Nitro "close" lifecycle hook using a server plugin, the code inside the hook doesn't get called when stopping the dev server (npm run dev then Ctrl C). However, if I run the production build and stop it, the hook does get called correctly.
I would expect that the close hook gets called so I can perform a graceful shutdown of my database connections and queues even on development, but for now it only seems to work on the production build.
For some reason, the next time I start the dev server, the logs from the close hook get called on startup but not on close...
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
https://stackblitz.com/edit/github-ftkhvf?file=server/plugins/shutdown.ts
Describe the bug
Even if I hook to the Nitro
"close"
lifecycle hook using a server plugin, the code inside the hook doesn't get called when stopping the dev server (npm run dev
thenCtrl C
). However, if I run the production build and stop it, the hook does get called correctly.I would expect that the close hook gets called so I can perform a graceful shutdown of my database connections and queues even on development, but for now it only seems to work on the production build.
For some reason, the next time I start the dev server, the logs from the close hook get called on startup but not on close...
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: