mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix deprecation warning when using redis-namespace (#5066)
We need to call the `script` command on the raw redis connection because passthrough for administrative commands has been deprecated and will be removed in redis-namespace 2.0 Co-authored-by: Heinrich Lee Yu <heinrich@gitlab.com>
This commit is contained in:
parent
837745ac9a
commit
e093c1b0f9
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ module Sidekiq
|
|||
private
|
||||
|
||||
def zpopbyscore(conn, keys: nil, argv: nil)
|
||||
@lua_zpopbyscore_sha = conn.script(:load, LUA_ZPOPBYSCORE) if @lua_zpopbyscore_sha.nil?
|
||||
if @lua_zpopbyscore_sha.nil?
|
||||
raw_conn = conn.respond_to?(:redis) ? conn.redis : conn
|
||||
@lua_zpopbyscore_sha = raw_conn.script(:load, LUA_ZPOPBYSCORE)
|
||||
end
|
||||
|
||||
conn.evalsha(@lua_zpopbyscore_sha, keys: keys, argv: argv)
|
||||
rescue Redis::CommandError => e
|
||||
|
|
Loading…
Reference in a new issue