2d233dac45
`project.pipeline_status.has_status?` is cached, which can lead to Error 500s in the UI if the this condition is used to check whether a pipeline exists for a commit. We now expire the cache to ensure that the information is consistent. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59453
13 lines
344 B
Ruby
13 lines
344 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Ci
|
|
class DestroyPipelineService < BaseService
|
|
def execute(pipeline)
|
|
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_pipeline, pipeline)
|
|
|
|
pipeline.destroy!
|
|
|
|
Gitlab::Cache::Ci::ProjectPipelineStatus.new(pipeline.project).delete_from_cache
|
|
end
|
|
end
|
|
end
|