Commit e842e682 authored by Nick Thomas's avatar Nick Thomas

Merge branch '4919-reset-force-redownload' into 'master'

Resolve "Geo: If repo was set to be redownloaded once it will be redownloaded always"

Closes #4919

See merge request gitlab-org/gitlab-ee!4506
parents b9709bdd 91bf0a6b
---
title: 'Geo: Reset force_redownload flag after successful sync'
merge_request:
author:
type: fixed
......@@ -108,6 +108,7 @@ module Geo
attrs["resync_#{type}"] = false
attrs["#{type}_retry_count"] = nil
attrs["#{type}_retry_at"] = nil
attrs["force_to_redownload_#{type}"] = false
end
registry.update!(attrs)
......
......@@ -210,6 +210,14 @@ describe Geo::RepositorySyncService do
subject.execute
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
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