Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Exit ledger-worker process on quit signal #357

Merged
Merged
Show file tree
Hide file tree
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: 5 additions & 2 deletions ledger-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ setInterval(()=>{
})
}, connected ? 5000:1000)



process.on('message', function (message) {
if (message.quit) {
process.exit()
}
})
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ function createWindow () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
if (ledgerWorker.connected) {
ledgerWorker.send({quit: true})
}
mainWindow = null
})

Expand Down