import { createClient, RedisClientType } from "redis"; import { REDIS_RECONNECT_INTERVAL } from "../environment"; export default function createRedisClientForRepository() { const client = createClient({ url: process.env.REDIS_URL, socket: { tls: process.env.NODE_ENV === 'production', rejectUnauthorized: false, reconnectStrategy: REDIS_RECONNECT_INTERVAL, }, }); return client as RedisClientType; }