Commit 73d1fab8 authored by Stan Hu's avatar Stan Hu

Merge branch 'mk/geo/mark-disabled-wikis-as-synced' into 'master'

Geo: Remove disabled wikis from out-of-sync queries

Closes #5361

See merge request gitlab-org/gitlab-ee!5089
parents 4dfeb060 f49570aa
......@@ -20,8 +20,18 @@ module Geo
return
end
unflag_disabled_wiki(registry)
Geo::RepositorySyncService.new(project).execute if registry.repository_sync_due?(scheduled_time)
Geo::WikiSyncService.new(project).execute if registry.wiki_sync_due?(scheduled_time)
end
private
def unflag_disabled_wiki(registry)
return unless registry.resync_wiki?
registry.update!(resync_wiki: false) unless registry.project.wiki_enabled?
end
end
end
......@@ -117,6 +117,10 @@ RSpec.describe Geo::ProjectSyncWorker do
it 'does not sync the project wiki' do
expect(wiki_sync_service).not_to have_received(:execute)
end
it 'unflags wiki for sync, to remove it from Geo wiki queries' do
expect(registry.reload.resync_wiki).to be_falsey
end
end
context 'when project repository was synced after the time the job was scheduled in' do
......
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