Welcome to mirror list, hosted at ThFree Co, Russian Federation.

destroy_service.rb « container_repository « projects « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 83bb8624bba1c010cd5edbc43a239d3066834813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Projects
  module ContainerRepository
    class DestroyService < BaseService
      def execute(container_repository)
        return false unless can?(current_user, :update_container_image, project)

        # Delete tags outside of the transaction to avoid hitting an idle-in-transaction timeout
        container_repository.delete_tags!
        container_repository.delete_failed! unless container_repository.destroy
      end
    end
  end
end