Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

handle exit signals cleanly #9374

Merged
merged 1 commit into from
Jun 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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