gitlab-org--gitlab-foss/app/services/ci/update_build_queue_service.rb

22 lines
457 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-12-15 16:37:52 -05:00
module Ci
2016-12-20 22:27:03 -05:00
class UpdateBuildQueueService
2016-12-15 16:37:52 -05:00
def execute(build)
tick_for(build, build.project.all_runners)
2017-10-30 11:17:17 -04:00
end
private
def tick_for(build, runners)
if Feature.enabled?(:ci_update_queues_for_online_runners, build.project, default_enabled: true)
runners = runners.with_recent_runner_queue
end
2017-10-30 11:17:17 -04:00
runners.each do |runner|
runner.pick_build!(build)
end
2016-12-15 16:37:52 -05:00
end
end
end