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

Fix deprecated uses of Redis#pipelined #603

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

casperisfine
Copy link

Context: redis/redis-rb#1059

The following is deprecated

redis.pipelined do
  redis.get(key)
end

And should be rewritten as:

redis.pipelined do |pipeline|
  pipeline.get(key)
end

Functionally it makes no difference.
This API is available since Redis 3.0.

@@ -125,14 +125,14 @@ def read_feature_keys
# Private: Gets a hash of fields => values for the given feature.
#
# Returns a Hash of fields => values.
def doc_for(feature)
def doc_for(feature, _pipeline: @client)
@client.hgetall(feature.key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use _pipeline?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 , yes absolutely...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Also since I noticed the doc mark the method as private, I droped the leading _.

Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.
@fabn
Copy link
Contributor

fabn commented Feb 17, 2022

Is there an ETA for this to be released? I hate to put github deps in Gem file. Thanks.

@jnunemaker
Copy link
Collaborator

Personally, I don't mind locking to a ref for a bit, but I just released 0.24.0 for you. :)

@fabn
Copy link
Contributor

fabn commented Feb 17, 2022

Thank you very much

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.

5 participants