Closed n-rodriguez closed 1 year ago
If you change a bit the code from: https://github.com/arturictus/sidekiq_alive/blob/0dddd80bc6e1f594018f02cb4e4eb4fc30701935/lib/sidekiq_alive.rb#L58-L65
to:
def self.deep_scan(keyword, keys = [], cursor = 0)
loop do
cursor, found_keys = SidekiqAlive.redis.scan(cursor, match: keyword, count: 1000)
keys += found_keys if found_keys
break if cursor.to_i == 0
end
keys
end
you get :
undefined method `to_i' for #<Enumerator: #<RedisClient redis://127.0.0.1:6379/2>:scan(0, match: SIDEKIQ_REGISTERED_INSTANCE::*, count: 1000)>
break if cursor.to_i == 0
^^^^^
Did you mean? to_s
to_a
to_h
I'm sorry, but is it possible that the error described here hasn't been addressed in the fix in https://github.com/arturictus/sidekiq_alive/pull/74?
Specifically, we're getting this error
undefined method `to_i' for #<Enumerator: #<RedisClient redis://127.0.0.1:6379/2>:scan(0, match: SIDEKIQ_REGISTERED_INSTANCE::*, count: 1000)>
break if cursor.to_i == 0
^^^^^
Since version 7,
sidekiq
useredis-client
in replacement ofredis
(https://github.com/mperham/sidekiq/blob/main/docs/7.0-Upgrade.md#redis-client). The Redis client API is no longer the same and so it breakssidekiq_alive
.