Skip to content

Commit

Permalink
Merge pull request #137 from Sebastian-Webster/136-zombie-processes-a…
Browse files Browse the repository at this point in the history
…re-created-when-exiting-nodejs-with-ctrl-+-c

Fix zombie processes
  • Loading branch information
Sebastian-Webster authored Nov 15, 2024
2 parents bb4db7c + 77801ad commit 5a2783c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
32 changes: 26 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
},
"dependencies": {
"adm-zip": "^0.5.16",
"semver": "^7.6.3"
"semver": "^7.6.3",
"signal-exit": "^4.1.0"
},
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions src/libraries/AbortSignal.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { onExit } from 'signal-exit'

const DBDestroySignal = new AbortController();

function abortSignal() {
Expand All @@ -6,7 +8,6 @@ function abortSignal() {
}
}

process.on('beforeExit', abortSignal)
process.on('exit', abortSignal)
onExit(abortSignal)

export default DBDestroySignal;

0 comments on commit 5a2783c

Please sign in to comment.