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

20 lines
413 B
Ruby
Raw Normal View History

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)
2017-01-19 17:31:03 -05:00
build.project.runners.each do |runner|
2016-12-15 16:37:52 -05:00
if runner.can_pick?(build)
runner.tick_runner_queue
2016-12-15 16:37:52 -05:00
end
end
2017-01-20 07:59:13 -05:00
return unless build.project.shared_runners_enabled?
2017-01-20 07:59:13 -05:00
Ci::Runner.shared.each do |runner|
if runner.can_pick?(build)
runner.tick_runner_queue
end
end
2016-12-15 16:37:52 -05:00
end
end
end