MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / getRedisClusterOptions

Function getRedisClusterOptions

server/redisConnection.js:60–87  ·  view source on GitHub ↗
(overridePrefix = null)

Source from the content-addressed store, hash-verified

58};
59
60const getRedisClusterOptions = (overridePrefix = null) => {
61 const clusterNodes = getRedisEnvValue("CLUSTER_NODES", overridePrefix);
62
63 if (clusterNodes) {
64 const nodes = clusterNodes.split(",").map((node) => {
65 const [host, port] = node.trim().split(":");
66 return { host, port: parseInt(port, 10) || 6379 };
67 });
68
69 const clusterOptions = {
70 enableReadyCheck: false,
71 redisOptions: {
72 password: getRedisEnvValue("PASSWORD", overridePrefix),
73 }
74 };
75
76 // Add TLS configuration if provided
77 const tlsCa = getRedisEnvValue("CA", overridePrefix);
78
79 if (tlsCa) {
80 clusterOptions.redisOptions.tls = { ca: tlsCa };
81 }
82
83 return { cluster: { nodes, options: clusterOptions } };
84 }
85
86 return null;
87};
88
89const getQueueOptions = () => {
90 // Check if cluster configuration is available

Callers 1

getQueueOptionsFunction · 0.85

Calls 1

getRedisEnvValueFunction · 0.85

Tested by

no test coverage detected