diff --git a/packages/text-to-speech/src/redis.ts b/packages/text-to-speech/src/redis.ts index 067c78627..350cb09f6 100644 --- a/packages/text-to-speech/src/redis.ts +++ b/packages/text-to-speech/src/redis.ts @@ -7,6 +7,13 @@ export const createRedisClient = async (url?: string, cert?: string) => { tls: url?.startsWith('rediss://'), // rediss:// is the protocol for TLS cert: cert?.replace(/\\n/g, '\n'), // replace \n with new line rejectUnauthorized: false, // for self-signed certs + connectTimeout: 10000, // 10 seconds + reconnectStrategy(retries: number): number | Error { + if (retries > 10) { + return new Error('Retries exhausted') + } + return 1000 + }, }, })