diff --git a/lib/core.ts b/lib/core.ts index 2b82371..5a34bae 100644 --- a/lib/core.ts +++ b/lib/core.ts @@ -75,17 +75,13 @@ export function initDB({ beforeTerminate() .catch(() => {}) .then(() => db.terminate()) - .then(() => process.exit(0)) .catch((error: unknown) => { // eslint-disable-next-line no-console console.error(error); - process.exit(-1); }); }; process.on('SIGINT', terminate); - process.on('SIGUSR1', terminate); - process.on('SIGUSR2', terminate); const CoreBaseModel = getModel(); CoreBaseModel.db = db; @@ -122,5 +118,5 @@ export function initDB({ }, }; logger.info('Core-db is up and running!'); - return {db, CoreBaseModel, helpers}; + return {db, terminate, CoreBaseModel, helpers}; }