We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1934ce commit f52166cCopy full SHA for f52166c
src/libraries/AbortSignal.ts
@@ -1,7 +1,12 @@
1
const DBDestroySignal = new AbortController();
2
3
-process.on('beforeExit', () => {
4
- DBDestroySignal.abort('Process is exiting')
5
-})
+function abortSignal() {
+ if (!DBDestroySignal.signal.aborted) {
+ DBDestroySignal.abort('Process is exiting')
6
+ }
7
+}
8
+
9
+process.on('beforeExit', abortSignal)
10
+process.on('exit', abortSignal)
11
12
export default DBDestroySignal;
0 commit comments