This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
[Reverted] Use Redis#exists? and fallback to #exists which could be either boolean or integer in recent redis gem versions #382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
First of all thanks for this amazing library!
I'm trying to upgrade redis from 4.4 to 4.6 in my project. It's rather painless but I noticed Vanity wasn't working properly as it assumes
exists
to return true or false which in recent redis-rb versions was changed and now it returns number of matching keys unlessRedis.exists_returns_integer
is set to false. But that option is deprecated and will be removed in redis-rb 5.0.So for boolean checks it is recommended to use
exists?
method and right now it's a bit messy with all that possibilities out there. So I tried not to break anything by checking forexists?
method which we now for sure gives us boolean result. And if that method is absent, we're probingexists
and if it's numeric we are calculating> 0
if not we're assuming it's boolean.So what do you think about that?