-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send SIGUSR2 signal on restart like nodemon? #21
Comments
That sounds sweet! |
The thing is that we're not killing the process, but rather removing some cached files from memory and then loading the server again (which is much faster). In turn, the user wouldn't be able to handle the restart by himself. Or maybe we should send a function to call after cleanup along with the event? |
I have a similar use-case where I have a readstream open and when micro-dev reloads, another stream starts and the existing one doesn't get killed. I think that's what happens, anyways; The code runs number-of-restarts times. I guess you'd need to have dev env only related code in your service then to handle cleaning up stuff like this, which I'm not sure you'd want. A thing that might be nice is a "cold reloading" switch, but just using nodemon with Very contrived example:
(type something into the same terminal micro-dev is running in and press enter. resave. repeat) |
Added in #48 |
Would it be possible to add a some signal, e.g.
SIGUSR2
before a restart to allow a micro server to perform some cleanup?nodemon
does this: https://github.com/remy/nodemon/#controlling-shutdown-of-your-scriptMy use-case is a
setInterval()
that I want to callclearInterval()
on each timemicro-dev
restarts the server. Right now I end up with one interval long running for every single start/restart of the server.The text was updated successfully, but these errors were encountered: