Skip to content

Commit

Permalink
feat: handle process disconnect event for graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Jan 22, 2025
1 parent 323289e commit fbbfdfc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/server/watch-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ process.on('message', (message: Message) => {
init(message.id, filePath, options)
}
})

process.on('disconnect', () => {
console.log('Parent process exited, shutting down...')
process.exit()
})

0 comments on commit fbbfdfc

Please sign in to comment.