Skip to content

Commit

Permalink
Merge pull request brave#9374 from brave/exit-signals
Browse files Browse the repository at this point in the history
handle exit signals cleanly
  • Loading branch information
bsclifton authored Jun 10, 2017
2 parents 66913ab + 3ef36a4 commit d66351b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ const initiateSessionStateSave = () => {
})
}

// exit cleanly on signals
['SIGTERM', 'SIGHUP', 'SIGINT', 'SIGBREAK'].forEach((signal) => {
process.on(signal, () => {
app.quit()
})
})

let loadAppStatePromise = SessionStore.loadAppState()

// Some settings must be set right away on startup, those settings should be handled here.
Expand Down

0 comments on commit d66351b

Please sign in to comment.