import { BullModuleOptions, SharedBullConfigurationFactory, } from '@nestjs/bull'; import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; @Injectable() export class BullConfigService implements SharedBullConfigurationFactory { constructor(private readonly configService: ConfigService) {} createSharedConfiguration(): BullModuleOptions { return { redis: { host: this.configService.getOrThrow('BULL_REDIS_HOST'), port: parseInt(this.configService.getOrThrow('BULL_REDIS_PORT'), 10), }, }; } }