summaryrefslogtreecommitdiff
path: root/app/services/pages/delete_service.rb
blob: 3dc9254718edfc58f0457a5fc39180cdcfc4f46a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Pages
  class DeleteService < BaseService
    def execute
      project.mark_pages_as_not_deployed # prevents domain from updating config when deleted
      project.pages_domains.delete_all

      DestroyPagesDeploymentsWorker.perform_async(project.id)

      # TODO: remove this call https://gitlab.com/gitlab-org/gitlab/-/issues/320775
      PagesRemoveWorker.perform_async(project.id) if Feature.enabled?(:pages_update_legacy_storage, default_enabled: true)
    end
  end
end