Commit 91bf0a6b authored by Valery Sizov's avatar Valery Sizov

Geo: Reset force_redownload flag after successful sync

parent 7afd29db
---
title: 'Geo: Reset force_redownload flag after successful sync'
merge_request:
author:
type: fixed
...@@ -108,6 +108,7 @@ module Geo ...@@ -108,6 +108,7 @@ module Geo
attrs["resync_#{type}"] = false attrs["resync_#{type}"] = false
attrs["#{type}_retry_count"] = nil attrs["#{type}_retry_count"] = nil
attrs["#{type}_retry_at"] = nil attrs["#{type}_retry_at"] = nil
attrs["force_to_redownload_#{type}"] = false
end end
registry.update!(attrs) registry.update!(attrs)
......
...@@ -210,6 +210,14 @@ describe Geo::RepositorySyncService do ...@@ -210,6 +210,14 @@ describe Geo::RepositorySyncService do
subject.execute subject.execute
end end
it 'sets the redownload flag to false after success' do
registry = create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD + 1, force_to_redownload_repository: true)
subject.execute
expect(registry.reload.force_to_redownload_repository).to be false
end
it 'tries to redownload repo' do it 'tries to redownload repo' do
create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD + 1) create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD + 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