2 Answers
- Newest
- Most votes
- Most comments
0
Hello. It may be a RetryStrategy on Redis, to be specified or a Cold Start of Lambda that you have to avoid.
For Redis try this.
const Redis = require('ioredis');
const redis = new Redis({
host: 'your_redis_host',
port: your_redis_port,
connectTimeout: 10000,
retryStrategy: (times) => {
return Math.min(times * 50, 2000); // Retry every 50ms, up to 2 seconds
}
});
For Lambda, create an event invoking the lambda function timely.
Relevant content
- Accepted Answerasked 3 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
Hi Giovanni, I'm still getting the redis connection timeout error after adding the retryStrategy. Attached the snippet of the log. Any other things I can try?