Commit 24f0a45b authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker

Do things in the correct order

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