Commit c7f93441 authored by James Lopez's avatar James Lopez Committed by Nick Thomas

Fix wiki retry count typo

parent a50afe7c
...@@ -37,7 +37,7 @@ module Geo ...@@ -37,7 +37,7 @@ module Geo
rescue Gitlab::Git::Repository::NoRepository => e rescue Gitlab::Git::Repository::NoRepository => e
log_error('Invalid wiki', e) log_error('Invalid wiki', e)
registry.update(force_to_redownload_wiki: true, registry.update(force_to_redownload_wiki: true,
repository_retry_count: retry_count + 1) wiki_retry_count: retry_count + 1)
ensure ensure
clean_up_temporary_repository if redownload clean_up_temporary_repository if redownload
end end
......
---
title: Fix Geo wiki sync error not increasing retry count
merge_request:
author:
type: fixed
...@@ -90,6 +90,14 @@ describe Geo::RepositorySyncService do ...@@ -90,6 +90,14 @@ describe Geo::RepositorySyncService do
expect { subject.execute }.not_to raise_error expect { subject.execute }.not_to raise_error
end end
it 'increases retry count when Gitlab::Git::Repository::NoRepository is raised' do
allow(repository).to receive(:fetch_as_mirror).with(url_to_repo, forced: true) { raise Gitlab::Git::Repository::NoRepository }
subject.execute
expect(Geo::ProjectRegistry.last.repository_retry_count).to eq(1)
end
context 'tracking database' do context 'tracking database' do
it 'creates a new registry if does not exists' do it 'creates a new registry if does not exists' do
expect { subject.execute }.to change(Geo::ProjectRegistry, :count).by(1) expect { subject.execute }.to change(Geo::ProjectRegistry, :count).by(1)
......
...@@ -71,6 +71,14 @@ RSpec.describe Geo::WikiSyncService do ...@@ -71,6 +71,14 @@ RSpec.describe Geo::WikiSyncService do
expect { subject.execute }.not_to raise_error expect { subject.execute }.not_to raise_error
end end
it 'increases retry count when Gitlab::Git::Repository::NoRepository is raised' do
allow(repository).to receive(:fetch_as_mirror).with(url_to_repo, forced: true) { raise Gitlab::Git::Repository::NoRepository }
subject.execute
expect(Geo::ProjectRegistry.last.wiki_retry_count).to eq(1)
end
context 'tracking database' do context 'tracking database' do
it 'creates a new registry if does not exists' do it 'creates a new registry if does not exists' do
expect { subject.execute }.to change(Geo::ProjectRegistry, :count).by(1) expect { subject.execute }.to change(Geo::ProjectRegistry, :count).by(1)
......
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