Unverified Commit 14791a4c authored by Craig Miskell's avatar Craig Miskell
Browse files

Better style code

parent 408bee66
...@@ -85,9 +85,8 @@ module GitLab ...@@ -85,9 +85,8 @@ module GitLab
# Default to 0; if all jobs are due in the future, there is no "negative" delay. # Default to 0; if all jobs are due in the future, there is no "negative" delay.
delay = 0 delay = 0
entry = conn.zrangebyscore(set, "-inf", now.to_s, limit: [0, 1], withscores: true).first _job, timestamp = conn.zrangebyscore(set, "-inf", now.to_s, limit: [0, 1], withscores: true).first
# entry[0] is the job as JSON, entry[1] is the score (timestamp) when it should execute delay = now - timestamp if timestamp
delay = now - entry[1] if entry
@metrics.add("sidekiq_#{set}_set_processing_delay_seconds", delay) @metrics.add("sidekiq_#{set}_set_processing_delay_seconds", delay)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment