Skip to content

Commit 5a2783c

Browse files
Merge pull request #137 from Sebastian-Webster/136-zombie-processes-are-created-when-exiting-nodejs-with-ctrl-+-c
Fix zombie processes
2 parents bb4db7c + 77801ad commit 5a2783c

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

package-lock.json

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
},
4141
"dependencies": {
4242
"adm-zip": "^0.5.16",
43-
"semver": "^7.6.3"
43+
"semver": "^7.6.3",
44+
"signal-exit": "^4.1.0"
4445
},
4546
"repository": {
4647
"type": "git",

src/libraries/AbortSignal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { onExit } from 'signal-exit'
2+
13
const DBDestroySignal = new AbortController();
24

35
function abortSignal() {
@@ -6,7 +8,6 @@ function abortSignal() {
68
}
79
}
810

9-
process.on('beforeExit', abortSignal)
10-
process.on('exit', abortSignal)
11+
onExit(abortSignal)
1112

1213
export default DBDestroySignal;

0 commit comments

Comments
 (0)