lib/sidekiq/api.rb in sidekiq-7.1.6 vs lib/sidekiq/api.rb in sidekiq-7.2.0
- old
+ new
@@ -677,11 +677,11 @@
loop do
range_start = page * page_size + offset_size
range_end = range_start + page_size - 1
elements = Sidekiq.redis { |conn|
- conn.zrange name, range_start, range_end, withscores: true
+ conn.zrange name, range_start, range_end, "withscores"
}
break if elements.empty?
page -= 1
elements.reverse_each do |element, score|
yield SortedEntry.new(self, score, element)
@@ -704,11 +704,11 @@
else
[score, score]
end
elements = Sidekiq.redis { |conn|
- conn.zrange(name, begin_score, end_score, "BYSCORE", withscores: true)
+ conn.zrange(name, begin_score, end_score, "BYSCORE", "withscores")
}
elements.each_with_object([]) do |element, result|
data, job_score = element
entry = SortedEntry.new(self, job_score, data)
@@ -879,10 +879,10 @@
# Returns the number of processes cleaned.
# :nodoc:
# @api private
def cleanup
# dont run cleanup more than once per minute
- return 0 unless Sidekiq.redis { |conn| conn.set("process_cleanup", "1", nx: true, ex: 60) }
+ return 0 unless Sidekiq.redis { |conn| conn.set("process_cleanup", "1", "NX", "EX", "60") }
count = 0
Sidekiq.redis do |conn|
procs = conn.sscan("processes").to_a
heartbeats = conn.pipelined { |pipeline|