diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-02 16:42:12 +0200 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-02 16:42:12 +0200 |
commit | 2261188f48dff25c5bfbbca739c5f570849155f4 (patch) | |
tree | fd05f58eb45f352d87440cd452506d231c07d4a9 | |
parent | 0e5c1a89f0b6ecf88fc340194d292fccbde99782 (diff) | |
download | gitlab-ce-2261188f48dff25c5bfbbca739c5f570849155f4.tar.gz |
Rename Runner#invalidate_build_cache -> Runner#pick_build
-rw-r--r-- | app/models/ci/runner.rb | 2 | ||||
-rw-r--r-- | app/services/ci/update_build_queue_service.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index cdd28407172..4d4aff4c830 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -205,7 +205,7 @@ module Ci end end - def invalidate_build_cache!(build) + def pick_build!(build) if can_pick?(build) tick_runner_queue end diff --git a/app/services/ci/update_build_queue_service.rb b/app/services/ci/update_build_queue_service.rb index 674782df00e..41b1c144c3e 100644 --- a/app/services/ci/update_build_queue_service.rb +++ b/app/services/ci/update_build_queue_service.rb @@ -8,7 +8,7 @@ module Ci def tick_for(build, runners) runners.each do |runner| - runner.invalidate_build_cache!(build) + runner.pick_build!(build) end end end diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index fa540f8d4fd..6ad37417623 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -792,7 +792,7 @@ describe Ci::Runner do end end - describe '#invalidate_build_cache!' do + describe '#pick_build!' do context 'runner can pick the build' do it 'calls #tick_runner_queue' do ci_build = build :ci_build @@ -801,7 +801,7 @@ describe Ci::Runner do expect(runner).to receive(:tick_runner_queue) - runner.invalidate_build_cache!(ci_build) + runner.pick_build!(ci_build) end end @@ -813,7 +813,7 @@ describe Ci::Runner do expect(runner).not_to receive(:tick_runner_queue) - runner.invalidate_build_cache!(ci_build) + runner.pick_build!(ci_build) end end end |