lib/sidekiq/api.rb in sidekiq-7.1.0 vs lib/sidekiq/api.rb in sidekiq-7.1.1
- old
+ new
@@ -90,15 +90,15 @@
pipeline.get("stat:failed")
pipeline.zcard("schedule")
pipeline.zcard("retry")
pipeline.zcard("dead")
pipeline.scard("processes")
- pipeline.lrange("queue:default", -1, -1)
+ pipeline.lindex("queue:default", -1)
end
}
- default_queue_latency = if (entry = pipe1_res[6].first)
+ default_queue_latency = if (entry = pipe1_res[6])
job = begin
Sidekiq.load_json(entry)
rescue
{}
end
@@ -262,11 +262,11 @@
# job in the queue was enqueued.
#
# @return [Float] in seconds
def latency
entry = Sidekiq.redis { |conn|
- conn.lrange(@rname, -1, -1)
- }.first
+ conn.lindex(@rname, -1)
+ }
return 0 unless entry
job = Sidekiq.load_json(entry)
now = Time.now.to_f
thence = job["enqueued_at"] || now
now - thence