diff --git a/src/app.module.ts b/src/app.module.ts index ecd283e..d280aa4 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -27,29 +27,29 @@ import { ScheduleModule } from '@nestjs/schedule'; isGlobal: true, load: [configuration], }), - CacheModule.registerAsync({ - isGlobal: true, - imports: [ConfigModule], - inject: [ConfigService], - useFactory: async (configService: ConfigService) => ({ - store: redisStore as unknown as CacheStoreFactory, - ttl: configService.get('CACHE_TTL', 5), - // Store-specific configuration: - password: configService.get('REDIS_PASS', ''), - host: configService.get('REDIS_HOST', 'localhost'), - port: configService.get('REDIS_PORT', 6379), - db: configService.get('REDIS_DB', 1), - }), - }), + // CacheModule.registerAsync({ + // isGlobal: true, + // imports: [ConfigModule], + // inject: [ConfigService], + // useFactory: async (configService: ConfigService) => ({ + // store: redisStore as unknown as CacheStoreFactory, + // ttl: configService.get('CACHE_TTL', 5), + // // Store-specific configuration: + // password: configService.get('redis.pass', ''), + // host: configService.get('redis.host', 'localhost'), + // port: configService.get('redis.port', 6379), + // db: configService.get('redis.db', 1), + // }), + // }), BullModule.forRootAsync({ imports: [ConfigModule], inject: [ConfigService], useFactory: async (configService: ConfigService) => ({ redis: { - password: configService.get('REDIS_PASS', ''), - host: configService.get('REDIS_HOST', 'localhost'), - port: configService.get('REDIS_PORT', 6379), - db: configService.get('REDIS_DB', 1), + password: configService.get('redis.pass', ''), + host: configService.get('redis.host', 'localhost'), + port: configService.get('redis.port', 6379), + db: configService.get('redis.db', 1), }, }), }), diff --git a/src/config/configuration.ts b/src/config/configuration.ts index 581eb1e..cc62f84 100644 --- a/src/config/configuration.ts +++ b/src/config/configuration.ts @@ -11,4 +11,10 @@ export default () => ({ channel: process.env.IRC_CHANNEL ?? '#usdev', password: process.env.IRC_PASSWORD ?? '', }, + redis: { + host: process.env.REDIS_HOST ?? 's3.hooli.co', + port: parseInt(process.env.REDIS_PORT ?? '6379'), + password: process.env.REDIS_PASS ?? '', + db: parseInt(process.env.REDIS_DB ?? '1'), + }, });