diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-21 13:58:31 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-21 13:58:31 +0100 |
commit | 830198b75c1fc75791187455f7976f0a87493ef7 (patch) | |
tree | f4fb575b8c553ba427f648371382016d266b32a0 /lib/api/helpers/runner.rb | |
parent | 46146e33f2f8dcbd52ee50eb9142887344b8c367 (diff) | |
download | gitlab-ce-improve-ci-redis-queueing.tar.gz |
Improve resiliency of build pickingimprove-ci-redis-queueing
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.
Diffstat (limited to 'lib/api/helpers/runner.rb')
-rw-r--r-- | lib/api/helpers/runner.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index 74848a6e144..265be59d36b 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -15,6 +15,14 @@ module API attributes_for_keys(%w(name version revision platform architecture), params['info']) end + def get_runner_version + params.fetch('info', {}).fetch('version', "unknown") + end + + def header_last_update(value) + header 'X-GitLab-Last-Update', value + end + def authenticate_runner! forbidden! unless current_runner end |