Closed moofkit closed 1 year ago
So I'm ok on principle, but I have a few concerns about the implementation, most notably the concept of doing parser.to_h.slice(...)
.
I think it would be better to just explicitly deal with the defaults in both initializers.
@casperisfine thanks for review and your suggestions!
I've refactored it in favour of explicit approach. Check the changes out please
Merged as https://github.com/redis-rb/redis-client/commit/ed821c0542eff31e227776f904c6a9c60a590f59 (I did some small edits)
Description
It's a proposal PR to adds
url
option for client config with sentinels After updatingredis
gem to 5.0 there are differences in sentinel configuration.Also it is a little confusing for users of redis-rb and sidekiq
Before update it was possible to configurate
name
,username
,password
,db
via url without explicit setting:This config will provide client connection to redis host with username
user
, passwordpass
and database12
.In the newest version it has to provide connection options explicitly:
The problem is that it's not very handy to provide a bunch of variables like
REDIS_USERNAME
,REDIS_DB
,REDIS_PASSWORD
, but have one plainREDIS_URL
to configure connection. So to stick with url it needs to write custom code to parse url something like that:So this PR is proposal to return old behavior to give an option to provide
url
to config as alternative to explicit kwargs