Commit b3daa3e5 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Stop deleting pages from legacy storage if it's disabled

parent 066610c7
......@@ -1792,6 +1792,8 @@ class Project < ApplicationRecord
# answer: we should just remove all of this
# rubocop: disable CodeReuse/ServiceClass
def remove_pages
return unless Feature.enabled?(:pages_update_legacy_storage, default_enabled: true)
# Projects with a missing namespace cannot have their pages removed
return unless namespace
......
......@@ -4139,6 +4139,15 @@ RSpec.describe Project, factory_default: :keep do
expect { project.remove_pages }.to change { pages_metadatum.reload.deployed }.from(true).to(false)
end
it 'does nothing if updates on legacy storage are disabled' do
stub_feature_flags(pages_update_legacy_storage: false)
expect(Gitlab::PagesTransfer).not_to receive(:new)
expect(PagesWorker).not_to receive(:perform_in)
project.remove_pages
end
it 'is run when the project is destroyed' do
expect(project).to receive(:remove_pages).and_call_original
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment