Skip to content

Redis#exists(key) will return an Integer in redis-rb 4.3. exists? returns a boolean, you should use it instead. #195

Open
@reedstonefood

Description

@reedstonefood

Using version 1.8.1 of this gem, redis 4.2, ruby 2.7.5 and sidekiq 6.4.1. I get this warning a lot in my sidekiq output:

`Redis#exists(key)` will return an Integer in redis-rb 4.3, if you want to keep the old behavior, use `exists?` instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer = true. (/Users/reedstonefood/.gem/ruby/2.7.5/gems/redis-namespace-1.8.1/lib/redis/namespace.rb:476:in `call_with_namespace')

Source code:

result = @redis.send(command, *args, &block)

This is a deprecation warning that was apparently fixed in version 1.8. However many people are reporting this error is still shown. This can be seen by the number of 👍 in the last two comments on #172

As there are no further official responses on that closed issue, am raising a new one to raise awareness of this issue & help any future googlers of this message know that they are not alone.

My understanding is that Mike (Sidekiq maintainer) believes this to be a problem with this gem, rather than with sidekiq. sidekiq/sidekiq#4591

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions