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 1b1735e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 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 SIGUSR2 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
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b1735e

Please sign in to comment.