-
Notifications
You must be signed in to change notification settings - Fork 212
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
Adds redis-rb:5.x compatibility #167
Conversation
57773e0
to
86db6aa
Compare
@jamesgolick @EricR could you please take a look? This is a humble attempt to allow higher versions of |
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.
This looks good — I came here to open a similar PR to get rid of the Redis.current
deprecation warnings¹, and found this pull request.
Just one note re. maintaining redis
4.x compatibility in the spec/spec_helper.rb
and README.md
example.
¹
`Redis.current` is deprecated and will be removed in 5.0.
(called from: …/rollout/spec/spec_helper.rb:26:in `block (2 levels) in <top (required)>')
host: ENV.fetch('REDIS_HOST', '127.0.0.1'), | ||
port: ENV.fetch('REDIS_PORT', '6379'), | ||
db: ENV.fetch('REDIS_DB', '7'), | ||
reconnect_attempts: [0.05, 0.1, 0.2] |
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.
$ bundle exec rspec
An error occurred while loading ./spec/rollout/feature_spec.rb.
Failure/Error:
REDIS_CURRENT = Redis.new(
host: ENV.fetch('REDIS_HOST', '127.0.0.1'),
port: ENV.fetch('REDIS_PORT', '6379'),
db: ENV.fetch('REDIS_DB', '7'),
reconnect_attempts: [0.05, 0.1, 0.2]
)
NoMethodError:
undefined method `to_i' for [0.05, 0.1, 0.2]:Array
# …/.gem/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:497:in `_parse_options'
# …/.gem/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:92:in `initialize'
# …/.gem/ruby/3.2.0/gems/redis-4.8.1/lib/redis.rb:87:in `new'
# …/.gem/ruby/3.2.0/gems/redis-4.8.1/lib/redis.rb:87:in `initialize'
# ./spec/spec_helper.rb:11:in `new'
# ./spec/spec_helper.rb:11:in `<top (required)>'
# ./spec/rollout/feature_spec.rb:1:in `require'
# ./spec/rollout/feature_spec.rb:1:in `<top (required)>'
Looks like this reconnect_attempts
is broken for redis-4.8.1
which is in within the >= 4.0', '< 6.0
declared dependency.
I've just created this project https://github.com/jcagarcia/rollout-redis for continue with the rollout gem support. It supports working with Redis 5 and new several functionalities :) feedback is totally welcome! |
Resolved via #170 |
Motivation:
Allow higher versions of redis.