BigW Consortium Gitlab

Commit 24f0a45b by Kim "BKC" Carlbäcker

Do things in the correct order

parent f6263e2e
......@@ -132,6 +132,7 @@ module Ci
def ensure_runner_queue_value
Gitlab::Redis.with do |redis|
value = Time.new.inspect
redis.set(runner_queue_key, value, ex: 60.minutes, nx: true)
redis.get(runner_queue_key)
end
......
......@@ -21,6 +21,8 @@ module Ci
return build_not_found!
end
new_update = current_runner.ensure_runner_queue_value
build = Ci::RegisterBuildService.new.execute(current_runner)
if build
......@@ -31,7 +33,6 @@ module Ci
else
Gitlab::Metrics.add_event(:build_not_found)
new_update = current_runner.ensure_runner_queue_value
headers 'X-GitLab-Last-Update', new_update
build_not_found!
......
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