Chapter 13. Production Grade API | Health Check Page | Code with Soumyajeet

  Рет қаралды 161

Code With Soumyajeet

Code With Soumyajeet

Күн бұрын

Пікірлер: 8
@aabhishakemishra
@aabhishakemishra 15 күн бұрын
Good job
@codewithsoumyajeet8417
@codewithsoumyajeet8417 15 күн бұрын
Thanks
@somyasikhanayak5565
@somyasikhanayak5565 23 күн бұрын
It was great 👌
@codewithsoumyajeet8417
@codewithsoumyajeet8417 23 күн бұрын
Thanks
@sushamamanjari9027
@sushamamanjari9027 23 күн бұрын
Good explanation
@codewithsoumyajeet8417
@codewithsoumyajeet8417 23 күн бұрын
Thank you
@devproacademy
@devproacademy 18 күн бұрын
Hello, I have an issue with these lines of code. try { const redisClient = new Redis({ host: process.env.REDIS_HOST, port: process.env.REDIS_PORT, }); const pingResult = await redisClient.ping(); if (pingResult === "PONG") { healthStatus.redis = "OK"; } else { healthStatus.redis = "DOWN"; } } catch (error) { healthStatus.redis = "DOWN"; overallHealthStatus = 503; console.log("Error connecting to Redis:>>>>>>", error); } I noticed this line throwing an error const pingResult = await redisClient.ping(); The error is "MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details". How do I fix this?
@codewithsoumyajeet8417
@codewithsoumyajeet8417 18 күн бұрын
Try these solutions. 1. Make sure you are able to read the env variables. Do console log on process.env.REDIS_HOST and see if you are seeing values. Try like this const redisClient = new Redis({ host: process.env.REDIS_HOST || 'localhost', port: process.env.REDIS_PORT || 6379, }); 2. Remove any quote mark in .env file REDIS_HOST=localhost REDIS_PORT=6379 3. Make sure the function is async function 4. Remove the mongo and rabbitmq and test the redis connection in isolation. 5. Check redis connection status. see if you are connecting before initialization redisClient.on('error', (err) => { console.log('Redis error event:', err); }); redisClient.on('connect', () => { console.log('Connected to Redis'); }); redisClient.on('ready', () => { console.log('Redis is ready'); });
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 14 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 49 МЛН
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 36 МЛН
JavaScript Fetch API | Lets Understand it clearly
29:55
JAFS Code School Tamil
Рет қаралды 10 М.
10 Essential React Native Tips Every Developer Must Know
12:07
Simon Grimm
Рет қаралды 13 М.
The Correct Way to Use Form Data in React
17:29
Cosden Solutions
Рет қаралды 11 М.
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 14 МЛН