diff options
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/api/builds.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 142bce82286..c4bdef781f7 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -16,6 +16,13 @@ module Ci not_found! unless current_runner.active? update_runner_info + if current_runner.is_runner_queue_value_latest?(params[:last_update]) + header 'X-GitLab-Last-Update', params[:last_update] + return build_not_found! + end + + new_update = current_runner.ensure_runner_queue_value + build = Ci::RegisterBuildService.new.execute(current_runner) if build @@ -26,6 +33,8 @@ module Ci else Gitlab::Metrics.add_event(:build_not_found) + header 'X-GitLab-Last-Update', new_update + build_not_found! end end |