You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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?
Beta Was this translation helpful? Give feedback.
All reactions