2018-09-17 05:26:22 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class BuildScheduleWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
include PipelineQueue
|
|
|
|
|
2018-09-25 01:30:11 -04:00
|
|
|
queue_namespace :pipeline_processing
|
|
|
|
|
2018-09-17 05:26:22 -04:00
|
|
|
def perform(build_id)
|
2018-09-24 07:02:26 -04:00
|
|
|
::Ci::Build.find_by_id(build_id).try do |build|
|
2018-09-25 01:30:11 -04:00
|
|
|
break unless build.scheduled?
|
|
|
|
|
2018-09-24 07:02:26 -04:00
|
|
|
Ci::RunScheduledBuildService
|
|
|
|
.new(build.project, build.user).execute(build)
|
2018-09-17 05:26:22 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|