import { Injectable } from '@nestjs/common'; import { BullOptionsFactory as Factory, BullModuleOptions } from '@nestjs/bull'; import { Configuration } from '&app/config/Configuration'; @Injectable() export class BullOptionsFactory implements Factory { private readonly host: string; private readonly port: string; private readonly auth: string; public constructor(config: Configuration) { this.host = config.getStringOrThrow('REDIS_HOST'); this.port = config.getStringOrThrow('REDIS_PORT'); this.auth = config.getStringOrThrow('REDIS_AUTH'); console.log('inside constrctor'); } public createBullOptions(): BullModuleOptions { console.log('inside createBullOptions'); // function has not been called return { redis: { host: this.host, port: Number(this.port), password: this.auth, }, }; } }