(overridePrefix = null)
| 31 | }; |
| 32 | |
| 33 | const getRedisOptions = (overridePrefix = null) => { |
| 34 | const host = getRedisEnvValue("HOST", overridePrefix); |
| 35 | if (!host) { |
| 36 | const envKey = `${overridePrefix || "CB_REDIS"}_HOST${isProduction() ? "" : "_DEV"}`; |
| 37 | console.error(`${envKey} is not set. The charts are not going to update automatically.`); // oxlint-disable-line no-console |
| 38 | } |
| 39 | |
| 40 | return { |
| 41 | host, |
| 42 | port: getRedisEnvValue("PORT", overridePrefix), |
| 43 | password: getRedisEnvValue("PASSWORD", overridePrefix), |
| 44 | db: getRedisEnvValue("DB", overridePrefix), |
| 45 | tls: getRedisEnvValue("CA", overridePrefix) |
| 46 | ? { ca: getRedisEnvValue("CA", overridePrefix) } |
| 47 | : undefined, |
| 48 | }; |
| 49 | }; |
| 50 | |
| 51 | const parsePositiveInt = (value, fallback) => { |
| 52 | const parsedValue = parseInt(value, 10); |
no test coverage detected