From 830198b75c1fc75791187455f7976f0a87493ef7 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 21 Mar 2017 13:58:31 +0100 Subject: Improve resiliency of build picking Every time we pick a new build, or we get into conflict we force runner to retry the operation to make sure that all builds are being picked. It makes us to loose one request, but also makes sure that we are consistent. It is fair trade, as number of generated builds is relatively small 0.1% compared to the traffic. --- lib/ci/api/helpers.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/ci/api/helpers.rb') diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb index 996990b464f..868a9cdec70 100644 --- a/lib/ci/api/helpers.rb +++ b/lib/ci/api/helpers.rb @@ -79,6 +79,14 @@ module Ci def max_artifacts_size current_application_settings.max_artifacts_size.megabytes.to_i end + + def get_runner_version + params.fetch('info', {}).fetch('version', "unknown") + end + + def header_last_update(value) + header 'X-GitLab-Last-Update', value + end end end end -- cgit v1.2.1