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
Which all works great, except, inside ioredis-adapter, if the connection is not open by the time it tries to perform get - it will throw an error
(node:2991) UnhandledPromiseRejectionWarning: Error: Connection is closed.
at IoRedisAdapter.<anonymous> (/Users/user/Dev/projects/events-streaming/node_modules/@type-cacheable/ioredis-adapter/dist/index.js:42:51)
at Generator.next (<anonymous>)
at /Users/user/Dev/projects/events-streaming/node_modules/@type-cacheable/ioredis-adapter/dist/index.js:8:71
Is there a way to catch this error or tell the adapter to skip if the connection is not there?
Thank you
The text was updated successfully, but these errors were encountered:
I am using
ioredis
withtype-cacheable
on AWS lambdas, and from time to time, the connection to Redis will time out.Some of my APIs are time-sensitive, and if the connection to Redis fails - I wanna skip the cache and proceed to DynamoDB as soon as possible.
Here's how Redis client configuration:
As you can see, I give 1.5 seconds for connection and retry once, and if that fails - I wanna move on.
I also don't want my logs to indicate errors, so I simply log them as
info
Which all works great, except, inside ioredis-adapter, if the connection is not open by the time it tries to perform
get
- it will throw an errorIs there a way to catch this error or tell the adapter to skip if the connection is not there?
Thank you
The text was updated successfully, but these errors were encountered: