Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
042440fc
Commit
042440fc
authored
Feb 14, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Geo] Fix redownload repository recovery when there is not local repo at all
parent
faba2d7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
ee/app/services/geo/base_sync_service.rb
ee/app/services/geo/base_sync_service.rb
+1
-2
ee/spec/services/geo/repository_sync_service_spec.rb
ee/spec/services/geo/repository_sync_service_spec.rb
+15
-1
No files found.
ee/app/services/geo/base_sync_service.rb
View file @
042440fc
...
@@ -184,8 +184,7 @@ module Geo
...
@@ -184,8 +184,7 @@ module Geo
# Remove the deleted path in case it exists, but it may not be there
# Remove the deleted path in case it exists, but it may not be there
gitlab_shell
.
remove_repository
(
project
.
repository_storage_path
,
deleted_disk_path_temp
)
gitlab_shell
.
remove_repository
(
project
.
repository_storage_path
,
deleted_disk_path_temp
)
# Move the original repository out of the way
if
project
.
repository_exists?
&&
!
gitlab_shell
.
mv_repository
(
project
.
repository_storage_path
,
repository
.
disk_path
,
deleted_disk_path_temp
)
unless
gitlab_shell
.
mv_repository
(
project
.
repository_storage_path
,
repository
.
disk_path
,
deleted_disk_path_temp
)
raise
Gitlab
::
Shell
::
Error
,
'Can not move original repository out of the way'
raise
Gitlab
::
Shell
::
Error
,
'Can not move original repository out of the way'
end
end
...
...
ee/spec/services/geo/repository_sync_service_spec.rb
View file @
042440fc
...
@@ -247,7 +247,21 @@ describe Geo::RepositorySyncService do
...
@@ -247,7 +247,21 @@ describe Geo::RepositorySyncService do
subject
.
execute
subject
.
execute
end
end
it
'successfully redownloads the file even if the retry time exceeds max value'
do
context
'no repository'
do
let
(
:project
)
{
create
(
:project
)
}
it
'does not raise an error'
do
project_registry
=
create
(
:geo_project_registry
,
project:
project
,
force_to_redownload_repository:
true
)
subject
.
execute
end
end
it
'successfully redownloads the repository even if the retry time exceeds max value'
do
timestamp
=
Time
.
now
.
utc
timestamp
=
Time
.
now
.
utc
registry
=
create
(
registry
=
create
(
:geo_project_registry
,
:geo_project_registry
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment