diff --git a/src/pool/pool.module.ts b/src/pool/pool.module.ts index 00ec45f..64ad85f 100644 --- a/src/pool/pool.module.ts +++ b/src/pool/pool.module.ts @@ -10,7 +10,12 @@ import {PoolService} from './pool.service'; exports: [PoolService] }) export class PoolModule implements OnApplicationShutdown { - constructor(private readonly moduleRef: ModuleRef) {} + constructor(private readonly moduleRef: ModuleRef) { + moduleRef.get(PoolService).on('error', error => { + // eslint-disable-next-line unicorn/no-process-exit + process.exit(1); + }); + } async onApplicationShutdown() { const pool = this.moduleRef.get(PoolService);