Commit f49570aa authored by Michael Kozono's avatar Michael Kozono

Remove disabled wikis from out-of-sync queries

parent c2cb9a3d
...@@ -20,8 +20,18 @@ module Geo ...@@ -20,8 +20,18 @@ module Geo
return return
end end
unflag_disabled_wiki(registry)
Geo::RepositorySyncService.new(project).execute if registry.repository_sync_due?(scheduled_time) Geo::RepositorySyncService.new(project).execute if registry.repository_sync_due?(scheduled_time)
Geo::WikiSyncService.new(project).execute if registry.wiki_sync_due?(scheduled_time) Geo::WikiSyncService.new(project).execute if registry.wiki_sync_due?(scheduled_time)
end 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
end end
...@@ -117,6 +117,10 @@ RSpec.describe Geo::ProjectSyncWorker do ...@@ -117,6 +117,10 @@ RSpec.describe Geo::ProjectSyncWorker do
it 'does not sync the project wiki' do it 'does not sync the project wiki' do
expect(wiki_sync_service).not_to have_received(:execute) expect(wiki_sync_service).not_to have_received(:execute)
end end
it 'unflags wiki for sync, to remove it from Geo wiki queries' do
expect(registry.reload.resync_wiki).to be_falsey
end
end end
context 'when project repository was synced after the time the job was scheduled in' do 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