1625979653
When deleting a pipeline, only some of the cache structures were being expired, but not the full pipeline list. We have to synchronously schedule a pipeline cache expiration because the pipeline will be deleted if the Sidekiq expiration job picks it up. To do this, properly extract all the logic buried in the Sidekiq worker into a service, and then call the service. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60469
13 lines
330 B
Ruby
13 lines
330 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)
|
|
|
|
Ci::ExpirePipelineCacheService.new.execute(pipeline, delete: true)
|
|
|
|
pipeline.destroy!
|
|
end
|
|
end
|
|
end
|