Skip to content

Commit

Permalink
Send SIGNUSR2 on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop committed Oct 24, 2017
1 parent 11e5017 commit c3778ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/serve.js
Original file line number Diff line number Diff line change
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 c3778ce

Please sign in to comment.