MCPcopy
hub / github.com/chartbrew/chartbrew / getRedisEnvValue

Function getRedisEnvValue

server/redisConnection.js:3–14  ·  view source on GitHub ↗
(name, overridePrefix = null)

Source from the content-addressed store, hash-verified

1const isProduction = () => process.env.NODE_ENV === "production";
2
3const getRedisEnvValue = (name, overridePrefix = null) => {
4 const suffix = isProduction() ? "" : "_DEV";
5
6 if (overridePrefix) {
7 const overrideValue = process.env[`${overridePrefix}_${name}${suffix}`];
8 if (overrideValue !== undefined && overrideValue !== "") {
9 return overrideValue;
10 }
11 }
12
13 return process.env[`CB_REDIS_${name}${suffix}`];
14};
15
16const hasRedisOverrides = (overridePrefix) => {
17 if (!overridePrefix) return false;

Callers 2

getRedisOptionsFunction · 0.85
getRedisClusterOptionsFunction · 0.85

Calls 1

isProductionFunction · 0.85

Tested by

no test coverage detected