Repository navigation
Replies: 1 comment
|
The likely cause is TLS on the nodes the client discovers, not the config endpoint itself.
Put TLS in redisClient = createCluster({
rootNodes: [
{ url: 'rediss://clustercfg.test-elasticache-redis-dev-redis-dev.u1tew9.usw2.cache.amazonaws.com:6379' },
],
defaults: {
password: TEST_REDIS_PASSWORD,
socket: {
tls: true,
connectTimeout: 10000,
},
},
});If it still hangs after that, listen for |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
// code
import { createCluster } from 'redis';
type RedisClusterType = ReturnType;
let redisClient: RedisClusterType | null = null;
export const initCache = async (): Promise => {
if (!redisClient) {
try {
redisClient = createCluster({
rootNodes: [
{
url: 'rediss://clustercfg.test-elasticache-redis-dev-redis-dev.u1tew9.usw2.cache.amazonaws.com:6379 ',
},
],
defaults: {
password: TEST_REDIS_PASSWORD,
socket: {
connectTimeout: 10000, // 10 seconds
},
},
});
}
};
its not getting connected its timing out because i set the timeoutPromise to 15 sec or else its struck at redisClient.connect()
can any one help me understand what i am doing wrong?
All reactions