diff --git a/lib/core.ts b/lib/core.ts index 540ec5a9..0f7d6ebd 100644 --- a/lib/core.ts +++ b/lib/core.ts @@ -1,10 +1,10 @@ import { - BeforeApplicationShutdown, DynamicModule, FactoryProvider, Global, Inject, Module, + OnApplicationShutdown, Provider, ValueProvider, } from "@nestjs/common"; @@ -25,7 +25,7 @@ import { @Global() @Module({}) -export class ObjectionCoreModule implements BeforeApplicationShutdown { +export class ObjectionCoreModule implements OnApplicationShutdown { constructor( @Inject(OBJECTION_MODULE_OPTIONS) private options: ObjectionModuleOptions, @@ -155,7 +155,7 @@ export class ObjectionCoreModule implements BeforeApplicationShutdown { }; } - async beforeApplicationShutdown(): Promise { + async onApplicationShutdown(): Promise { await this.disconnect(); }