diff --git a/auto-bid-server/src/modules/app-configs/app-configs.module.ts b/auto-bid-server/src/modules/app-configs/app-configs.module.ts index f13e642..ceb38c9 100644 --- a/auto-bid-server/src/modules/app-configs/app-configs.module.ts +++ b/auto-bid-server/src/modules/app-configs/app-configs.module.ts @@ -1,6 +1,6 @@ import { BullModule } from '@nestjs/bull'; import { Global, Module } from '@nestjs/common'; -import { ConfigModule } from '@nestjs/config'; +import { ConfigModule, ConfigService } from '@nestjs/config'; import { EventEmitterModule } from '@nestjs/event-emitter'; import { ScheduleModule } from '@nestjs/schedule'; @@ -14,11 +14,15 @@ import { ScheduleModule } from '@nestjs/schedule'; wildcard: true, global: true, }), - BullModule.forRoot({ - redis: { - host: 'localhost', - port: 6379, - }, + BullModule.forRootAsync({ + imports: [ConfigModule], + useFactory: (configService: ConfigService) => ({ + redis: { + host: configService.get('REDIS_HOST'), + port: configService.get('REDIS_PORT'), + }, + }), + inject: [ConfigService], }), BullModule.registerQueue({ name: 'mail-queue',