Commit 94b2df02 authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker

Make ensure_runner_queue_value atomic

parent 811addf2
...@@ -132,12 +132,14 @@ module Ci ...@@ -132,12 +132,14 @@ module Ci
def ensure_runner_queue_value def ensure_runner_queue_value
Gitlab::Redis.with do |redis| Gitlab::Redis.with do |redis|
value = redis.get(runner_queue_key) redis.multi do
if value == "" value = redis.get(runner_queue_key)
value = Time.new.inspect if value == ""
redis.set(runner_queue_key, value, ex: 60.minutes) value = Time.new.inspect
redis.set(runner_queue_key, value, ex: 60.minutes)
end
value
end end
value
end end
end end
......
Markdown is supported
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