You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please
Create a proper example with README how to add Redis module and consume it in application to listen to Redis client !!
import { DynamicModule } from '@nestjs/common';
import { RedisModule, RedisModuleOptions} from 'nestjs-redis';
import { RedisConfigError } from '../database/db.error';
import { ConfigModule } from '../config/config.module';
import { ConfigService } from '../config/config.service';
export class CacheModule {
public static getRedisOptions(config: ConfigService): RedisModuleOptions {
const redisConfig = config.get().redis;
if (!redisConfig) {
throw new RedisConfigError('redis config is missing');
}
return redisConfig as RedisModuleOptions;
}
public static forRoot(): DynamicModule {
return {
module: CacheModule,
imports: [
RedisModule.forRootAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => CacheModule.getRedisOptions(configService),
inject: [ConfigService]
}),
],
controllers: [],
providers: [],
exports: [],
};
}
}
Look like some dependancy is breaking when i am trying to create service and injecting that service in controllers where i have already added this redisModule in main module
The text was updated successfully, but these errors were encountered:
Please
Create a proper example with README how to add Redis module and consume it in application to listen to Redis client !!
Look like some dependancy is breaking when i am trying to create service and injecting that service in controllers where i have already added this redisModule in main module
The text was updated successfully, but these errors were encountered: