Closed
Description
Hi there!
Thanks for great package.
I planned to use it, but I did not found a way to inject ConfigService to provide Redis or RabbitMQ credentials.
Is it possible to do this now with forRootAsync or registerAsync option?
Like in this example:
CacheModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
isGlobal: true,
useFactory: async (configService: ConfigService) => {
return {
stores: [
createKeyv(
{
url: `redis://${configService.getOrThrow<string>('REDIS_HOST')}:${configService.getOrThrow<number>('REDIS_PORT')}`,
database: configService.getOrThrow<number>('REDIS_DB'),
password: configService.get<string | undefined>('REDIS_PASSWORD'),
},
),
],
};
},
})