-
Notifications
You must be signed in to change notification settings - Fork 13
#1983 - Changed Redis client to ioredis for local development #1996
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
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
andrepestana-aot
left a comment
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.
Good catch!
ann-aot
left a comment
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.
👍 Good catch
sh16011993
left a comment
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.
Good catch, LGTM 👍
dheepak-aot
left a comment
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.
guru-aot
left a comment
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.
Great find before deploying to prod @andrewsignori-aot :)









While using the standalone mode (local development only) the configuration used was meant to be used by
ioredisclient but it was configured to useredisclient. For reference only, this is the method on the Typeorm source code where the initialization of the specific client happens: https://github.com/typeorm/typeorm/blob/master/src/cache/RedisQueryResultCache.ts#L50This is the Typeorm documention that states that the connection can happen using
redisorioredisclient: https://orkhan.gitbook.io/typeorm/docs/cachingExpected by
redisclientAs shown below, the
redisclient requires asocketconfiguration. because the information about the host/port was not properly provided toredisclient the connectivity was established on localhost:6379 by default, which explains why it was working from our localhost ad failing from the docker-compose.redisclient configuration options: https://github.com/redis/node-redis/blob/master/docs/client-configuration.mdExpected by
ioredisclientioredisconfiguration options: https://github.com/luin/ioredis/blob/v4/API.md#new-redisport-host-optionsWhy use
ioredisclient?ioredisis also a Bull Queue framework dependency and it is also already used for the cluster mode, so it seems better to just use the same client for the standalone connection.