Skip to content

Commit

Permalink
fix: 改为向子进程发送signal,而不是直接disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jun 29, 2024
1 parent 22cbee0 commit 33afcfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function forkWorker(): void {
}
})

function onStop(): void {
worker.disconnect()
function onStop(signal: string): void {
worker.kill(signal)
worker.on('exit', () => {
// eslint-disable-next-line n/no-process-exit
process.exit(0)
Expand Down

0 comments on commit 33afcfd

Please sign in to comment.