Skip to content

Commit

Permalink
migrate "exists" to new Redis version and update to redis 4.2.0 (#5135)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRusskiy authored Jan 23, 2022
1 parent bb6aba2 commit f814f4b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/sidekiq/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def each
procs = sscan(conn, 'processes')
procs.sort.each do |key|
valid, workers = conn.pipelined do
conn.exists(key)
conn.exists?(key)
conn.hgetall("#{key}:workers")
end
next unless valid
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/launcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def ❤
_, exists, _, _, msg = Sidekiq.redis do |conn|
conn.multi do
conn.sadd('processes', key)
conn.exists(key)
conn.exists?(key)
conn.hmset(key, 'info', to_json, 'busy', curstate.size, 'beat', Time.now.to_f, 'quiet', @done)
conn.expire(key, 60)
conn.rpop("#{key}-signals")
Expand Down
2 changes: 1 addition & 1 deletion sidekiq.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.version = Sidekiq::VERSION
gem.required_ruby_version = ">= 2.2.2"

gem.add_dependency 'redis', '>= 3.3.5', '< 4.2'
gem.add_dependency "redis", ">= 4.2.0"
gem.add_dependency 'connection_pool', '~> 2.2', '>= 2.2.2'
gem.add_dependency 'rack', '~> 2.0'
gem.add_dependency 'rack-protection', '>= 1.5.0'
Expand Down
2 changes: 1 addition & 1 deletion test/test_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class ApiWorker

Sidekiq.redis do |conn|
refute conn.smembers('queues').include?('foo')
refute conn.exists('queue:foo')
refute conn.exists?('queue:foo')
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def perform(a, b)

Sidekiq.redis do |conn|
refute conn.smembers('queues').include?('foo')
refute conn.exists('queue:foo')
refute conn.exists?('queue:foo')
end
end

Expand Down

0 comments on commit f814f4b

Please sign in to comment.