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
005ebf93
Commit
005ebf93
authored
Nov 11, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Geo][error handling] [address review comments] catching some errors
parent
97cb306f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
app/services/geo/base_sync_service.rb
app/services/geo/base_sync_service.rb
+18
-4
No files found.
app/services/geo/base_sync_service.rb
View file @
005ebf93
...
...
@@ -183,7 +183,10 @@ module Geo
end
def
build_temporary_repository
gitlab_shell
.
add_repository
(
project
.
repository_storage
,
disk_path_temp
)
unless
gitlab_shell
.
add_repository
(
project
.
repository_storage
,
disk_path_temp
)
raise
Gitlab
::
Shell
::
Error
,
'Can not create a temporary repository'
end
repository
.
clone
.
tap
{
|
repo
|
repo
.
disk_path
=
disk_path_temp
}
end
...
...
@@ -192,9 +195,20 @@ module Geo
end
def
set_temp_repository_as_main
log_info
(
"Setting newly downloaded
#{
type
}
as a main one"
)
gitlab_shell
.
remove_repository
(
project
.
repository_storage_path
,
repository
.
disk_path
)
gitlab_shell
.
mv_repository
(
project
.
repository_storage_path
,
disk_path_temp
,
repository
.
disk_path
)
log_info
(
"Setting newly downloaded repository as main"
,
storage_path:
project
.
repository_storage_path
,
temp_path:
disk_path_temp
,
disk_path:
repository
.
disk_path
)
unless
gitlab_shell
.
remove_repository
(
project
.
repository_storage_path
,
repository
.
disk_path
)
raise
Gitlab
::
Shell
::
Error
,
'Can not remove outdated main repository to replace it'
end
unless
gitlab_shell
.
mv_repository
(
project
.
repository_storage_path
,
disk_path_temp
,
repository
.
disk_path
)
raise
Gitlab
::
Shell
::
Error
,
'Can not move temporary repository'
end
end
end
end
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