25 lines
588 B
Ruby
25 lines
588 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Ci
|
|
module Pipeline
|
|
module Chain
|
|
class Create < Chain::Base
|
|
include Chain::Helpers
|
|
|
|
def perform!
|
|
BulkInsertableAssociations.with_bulk_insert(enabled: ::Gitlab::Ci::Features.bulk_insert_on_create?(project)) do
|
|
pipeline.save!
|
|
end
|
|
rescue ActiveRecord::RecordInvalid => e
|
|
error("Failed to persist the pipeline: #{e}")
|
|
end
|
|
|
|
def break?
|
|
!pipeline.persisted?
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|