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)
|
2016-12-16 10:39:40 -05:00
|
|
|
runner.tick_runner_queue
|
2016-12-15 16:37:52 -05:00
|
|
|
end
|
|
|
|
end
|
2017-01-20 07:59:13 -05:00
|
|
|
|
2017-01-20 08:32:32 -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
|
2017-01-20 08:32:32 -05:00
|
|
|
end
|
2016-12-15 16:37:52 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|