( url: string | undefined )
| 43 | * spread this; callers add their own retry / timeout policy on top. |
| 44 | */ |
| 45 | export function getRedisConnectionDefaults( |
| 46 | url: string | undefined |
| 47 | ): Pick<RedisOptions, 'keepAlive' | 'connectTimeout' | 'enableOfflineQueue' | 'tls'> { |
| 48 | const tls = resolveRedisTlsOptions(url) |
| 49 | return { |
| 50 | keepAlive: 1000, |
| 51 | connectTimeout: 10000, |
| 52 | enableOfflineQueue: true, |
| 53 | ...(tls ? { tls } : {}), |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | interface RedisState { |
| 58 | client: Redis | null |
no test coverage detected