/** * Redis Configuration for different environments */ import { ENV_CONFIG } from './environment'; export interface RedisConfig { host: string; port: number; lazyConnect: boolean; retryDelayOnFailover: number; maxRetriesPerRequest: number; connectTimeout: number; } /** * Environment-based Redis configuration */ const getRedisConfig = (): RedisConfig => { return { host: ENV_CONFIG.redis.host, port: ENV_CONFIG.redis.port, lazyConnect: true, retryDelayOnFailover: 100, maxRetriesPerRequest: 3, connectTimeout: 10000, }; }; /** * Channels to subscribe to */ export const REDIS_CHANNELS = [ 'new_token_created', 'token_cex_updated', 'max_depth_reached', ] as const; /** * Get the current Redis configuration */ export const REDIS_CONFIG = getRedisConfig(); /** * Log current configuration (without sensitive data) */ export const logRedisConfig = (): void => { const env = process.env.NODE_ENV || 'development'; console.info(`[REDIS] Environment: ${env}`); console.info(`[REDIS] Connecting to: ${REDIS_CONFIG.host}:${REDIS_CONFIG.port}`); };