Skip to content

Commit e1934ce

Browse files
change exit to beforeExit
1 parent 348d181 commit e1934ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import { randomUUID } from "crypto";
1111
import {normalize as normalizePath} from 'path'
1212
import CONSTANTS from './constants'
1313

14-
process.on('exit', () => {
15-
DBDestroySignal.abort('Process is exiting')
16-
})
17-
1814
export async function createDB(opts?: ServerOptions) {
1915
const defaultOptions: InternalServerOptions = {
2016
dbName: 'dbdata',

src/libraries/AbortSignal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
const DBDestroySignal = new AbortController();
22

3+
process.on('beforeExit', () => {
4+
DBDestroySignal.abort('Process is exiting')
5+
})
6+
37
export default DBDestroySignal;

0 commit comments

Comments
 (0)