redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
125 stars 60 forks source link

sscan without block #24

Closed mperham closed 2 years ago

mperham commented 2 years ago

I have this code in Sidekiq:

       procs = conn.sscan_each("processes").to_a

This worked in 0.4.0 and broke in the latest version. Recall that I need code which works with both redis-rb and redis-client.

ArgumentError: can't issue an empty redis command
    /Users/mperham/.gem/ruby/3.0.3/gems/redis-client-0.5.0/lib/redis_client/command_builder.rb:44:in `generate!'
    /Users/mperham/.gem/ruby/3.0.3/gems/redis-client-0.5.0/lib/redis_client.rb:245:in `sscan'
    /Users/mperham/src/sidekiq/lib/sidekiq/api.rb:972:in `each'
    /Users/mperham/src/sidekiq/lib/sidekiq/api.rb:972:in `to_a'
    /Users/mperham/src/sidekiq/lib/sidekiq/api.rb:972:in `block in each'
    /Users/mperham/src/sidekiq/lib/sidekiq.rb:156:in `block in redis'
casperisfine commented 2 years ago

Thank you for the bug report. We were lacking coverage on scan methods with no extra arguments other than the key.

I released a 0.5.1 with the fix.

mperham commented 2 years ago

Verified. Thank you!