1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Avoid use of Array#pop

This commit is contained in:
Ismael Abreu 2015-01-17 03:06:09 +00:00
parent 20c616e971
commit 7cb9f42523

View file

@ -52,7 +52,6 @@ module Sidekiq
conn.zcard('retry')
conn.zcard('dead')
conn.scard('processes')
conn.lrange("queue:default", -1, -1)
conn.smembers('processes')
conn.smembers('queues'.freeze)
@ -66,8 +65,9 @@ module Sidekiq
end
end
workers_size = pipe2_res.pop(pipe1_res[7].size).map(&:to_i).inject(0, &:+)
enqueued = pipe2_res.pop(pipe1_res[8].size).map(&:to_i).inject(0, &:+)
s = pipe1_res[7].size
workers_size = pipe2_res[0...s].map(&:to_i).inject(0, &:+)
enqueued = pipe2_res[s..-1].map(&:to_i).inject(0, &:+)
default_queue_latency = if (entry = pipe1_res[6].first)
Time.now.to_f - Sidekiq.load_json(entry)['enqueued_at']