Skip to content

Commit

Permalink
Send SIGNUSR2 on restart (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop authored and leo committed Oct 24, 2017
1 parent 11e5017 commit b0281bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/serve.js
Expand Up @@ -11,6 +11,11 @@ module.exports = async (file, flags, restarting) => {
// Ensure that the loaded files have the correct env
process.env.NODE_ENV = process.env.NODE_ENV || 'development'

// Emit SIGNUSR2 to signal restart to user code
if (restarting) {
process.emit('SIGNUSR2')
}

// And then load the files
const module = flags.silent ? getModule(file) : log(getModule(file))
const server = serve(module)
Expand Down

0 comments on commit b0281bf

Please sign in to comment.