Skip to content
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

Closed

Conversation

smarjin
Copy link

@smarjin smarjin commented Dec 8, 2022

Motivation:

Allow higher versions of redis.

@smarjin smarjin marked this pull request as ready for review December 8, 2022 19:24
@smarjin smarjin force-pushed the feature/add-redis5-compatibility branch from 57773e0 to 86db6aa Compare December 8, 2022 19:48
@smarjin
Copy link
Author

smarjin commented Dec 9, 2022

@jamesgolick @EricR could you please take a look? This is a humble attempt to allow higher versions of redis-rb.

Copy link

@pda pda left a 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]
Copy link

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.

@jcagarcia
Copy link

jcagarcia commented Oct 23, 2023

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!

@reneklacan
Copy link
Member

Resolved via #170

@reneklacan reneklacan closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants