Skip to content
Snippets Groups Projects
Commit 1e22513a authored by Stan Hu's avatar Stan Hu
Browse files

Merge branch 'optimise-paused-runners' into 'master'

Optimise paused runners

See merge request gitlab-org/gitlab-ce!19946
parents 7b1eb2a6 cc48d67c
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
---
title: Optimise paused runners to reduce amount of used requests
merge_request:
author:
type: performance
Loading
Loading
@@ -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]
Loading
Loading
Loading
Loading
@@ -351,11 +351,13 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
context 'when valid token is provided' do
context 'when Runner is not active' do
let(:runner) { create(:ci_runner, :inactive) }
let(:update_value) { runner.ensure_runner_queue_value }
 
it 'returns 204 error' do
request_job
 
expect(response).to have_gitlab_http_status 204
expect(response).to have_gitlab_http_status(204)
expect(response.header['X-GitLab-Last-Update']).to eq(update_value)
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment