-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2044 Add Ignore errors and timeout for ORM Cache #2130
#2044 Add Ignore errors and timeout for ORM Cache #2130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done and thanks for the further explanations on the PR description. Looks good 👍
* Ref for cluster: https://github.com/redis/ioredis/tree/v4#cluster | ||
*/ | ||
export const ORM_CACHE_REDIS_RETRY_INTERVAL = 60 * 1000; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding. Why are we having the redis retry and the timeout same interval? Doesnt the retry should be lesser or the timeout more?
}, | ||
ignoreErrors: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work @dheepak-aot
Ignore Errors and add timeout
ignoreErrors: true
to the orm cache config.commandTimeout
of redis to 60 seconds in cache config which is infinite by default.Retry Strategy (https://github.com/redis/ioredis/tree/v4#auto-reconnect)
When
ignoreErrors: true
is set, errors are ignored and the typeorm works normally but the redis client(ioredis and ioredis/cluster) does retry every 2 seconds to connect again to redis server and creates log for every retry.This is due to the default implementation of
retryStrategy
andclusterRetryStrategy
.