diff options
| author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-06-17 16:47:25 +0200 |
|---|---|---|
| committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-06-17 16:52:17 +0200 |
| commit | cc48d67ca57ac99e5c61b422a56d96a1643a7de8 (patch) | |
| tree | 01c5eb4f4c3e637b0ee2ff345fae7567fa1804b7 /lib/api/runner.rb | |
| parent | 7b1eb2a669ad2a44dbe89d7d289d72870cbd74e7 (diff) | |
| download | gitlab-ce-cc48d67ca57ac99e5c61b422a56d96a1643a7de8.tar.gz | |
Optimised paused runners to not re-query every 3soptimise-paused-runners
We have long polling mechanism which is not being used by paused runners.
This makes the paused runner to generate a request every 3s,
where it could be fired only every 1h.
Diffstat (limited to 'lib/api/runner.rb')
| -rw-r--r-- | lib/api/runner.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index dc102259ca8..96a02914faa 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -84,7 +84,11 @@ module API end post '/request' do authenticate_runner! - no_content! unless current_runner.active? + + unless current_runner.active? + header 'X-GitLab-Last-Update', current_runner.ensure_runner_queue_value + break no_content! + end if current_runner.runner_queue_value_latest?(params[:last_update]) header 'X-GitLab-Last-Update', params[:last_update] |
