Nodemon: Sleep option?

Created on 7 Apr 2015  路  2Comments  路  Source: remy/nodemon

I have what may be a strange issue, but nodemon is literally too fast on its shutdown/startup on my machine. Basically there isn't enough time between nodemon shutting down the existing server and starting up the new instance. This means that every time I get an error of EADDRINUSE since the handle to the socket hasn't been released yet.

I tried the delay option but that seems to only slow down the time from when the change was detected to when it restarts. Is there some type of sleep option that will set how long to wait before starting the new instance? If not, can I submit this as a feature request :)

Most helpful comment

Feel free to submit a feature PR, but I think you're right, the --delay just delays when it stops and starts, rather than a sleep time in between.

A potential work around is to use sleep as part of your exec:

$ nodemon app.js -x 'sleep 1; node'

I think that would work, but I suspect more people might want to see this as part of nodemon.

All 2 comments

Feel free to submit a feature PR, but I think you're right, the --delay just delays when it stops and starts, rather than a sleep time in between.

A potential work around is to use sleep as part of your exec:

$ nodemon app.js -x 'sleep 1; node'

I think that would work, but I suspect more people might want to see this as part of nodemon.

Hello, I summit a PR to add suport delay before start, see #1693

Was this page helpful?
0 / 5 - 0 ratings