diff --git a/src/modules/configuration/configuration.module.ts b/src/modules/configuration/configuration.module.ts index 1c3cdff..52415ee 100644 --- a/src/modules/configuration/configuration.module.ts +++ b/src/modules/configuration/configuration.module.ts @@ -1,4 +1,4 @@ -import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq'; +import { RabbitMQConfig, RabbitMQModule } from '@golevelup/nestjs-rabbitmq'; import { RedisModule, RedisModuleOptions } from '@liaoliaots/nestjs-redis'; import { Module } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; @@ -17,18 +17,19 @@ import { SetConfigurationUseCase } from './domain/usecases/set-configuration.use inject: [ConfigService], useFactory: async ( configService: ConfigService, - ): Promise => { - return { - config: { - host: configService.get('REDIS_HOST'), - port: configService.get('REDIS_PORT'), - }, - }; - }, + ): Promise => ({ + config: { + host: configService.get('REDIS_HOST'), + port: configService.get('REDIS_PORT'), + }, + }), }), RabbitMQModule.forRootAsync(RabbitMQModule, { imports: [ConfigModule], - useFactory: async (configService: ConfigService) => ({ + inject: [ConfigService], + useFactory: async ( + configService: ConfigService, + ): Promise => ({ exchanges: [ { name: 'configuration', @@ -39,7 +40,6 @@ import { SetConfigurationUseCase } from './domain/usecases/set-configuration.use connectionInitOptions: { wait: false }, enableControllerDiscovery: true, }), - inject: [ConfigService], }), ], controllers: [ConfigurationMessagerController],