diff options
Diffstat (limited to 'app/workers/ci/build_schedule_worker.rb')
-rw-r--r-- | app/workers/ci/build_schedule_worker.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/ci/build_schedule_worker.rb b/app/workers/ci/build_schedule_worker.rb new file mode 100644 index 00000000000..448fb5bf41e --- /dev/null +++ b/app/workers/ci/build_schedule_worker.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Ci + class BuildScheduleWorker + include ApplicationWorker + include PipelineQueue + + def perform(build_id) + ::Ci::Build.preload(:build_schedule).find_by(id: build_id).try do |build| + break unless build.build_schedule.present? + + Ci::PlayBuildService.new(build.project, build.user).execute(build) + end + end + end +end |