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
7dae62cb
Commit
7dae62cb
authored
Nov 23, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor failure logging after merge with master
parent
79460248
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
app/services/geo/base_sync_service.rb
app/services/geo/base_sync_service.rb
+0
-6
app/services/geo/repository_sync_service.rb
app/services/geo/repository_sync_service.rb
+25
-15
No files found.
app/services/geo/base_sync_service.rb
View file @
7dae62cb
...
...
@@ -150,12 +150,6 @@ module Geo
registry
.
update!
(
attrs
)
end
def
fail_registry
(
message
,
error
)
log_error
(
message
,
error
)
registry
.
update!
(
last_repository_sync_failure:
"
#{
message
}
:
#{
error
.
message
}
"
)
end
def
type
self
.
class
.
type
end
...
...
app/services/geo/repository_sync_service.rb
View file @
7dae62cb
...
...
@@ -20,8 +20,9 @@ module Geo
else
project
.
ensure_repository
fetch_geo_mirror
(
project
.
repository
)
end
update_registry
(
finished_at:
DateTime
.
now
)
end
update_registry
(
finished_at:
DateTime
.
now
)
log_info
(
'Finished repository sync'
,
update_delay_s:
update_delay_in_seconds
,
download_time_s:
download_time_in_seconds
)
...
...
@@ -29,11 +30,13 @@ module Geo
Gitlab
::
Git
::
RepositoryMirroring
::
RemoteError
,
Geo
::
EmptyCloneUrlPrefixError
=>
e
fail_registry
(
'Error syncing repository'
,
e
)
registry
.
increment!
(
:repository_retry_count
)
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
fail_registry
(
'Invalid repository'
,
e
)
log_info
(
'Setting force_to_redownload flag'
)
registry
.
update
(
force_to_redownload_repository:
true
,
repository_retry_count:
retry_count
+
1
)
log_info
(
'Expiring caches'
)
registry
.
update
(
force_to_redownload_repository:
true
)
log_info
(
'Expiring caches'
)
project
.
repository
.
after_create
ensure
clean_up_temporary_repository
if
redownload
...
...
@@ -52,6 +55,13 @@ module Geo
project
.
repository
end
def
fail_registry
(
message
,
error
)
log_error
(
message
,
error
)
registry
.
update!
(
last_repository_sync_failure:
"
#{
message
}
:
#{
error
.
message
}
"
,
repository_retry_count:
retry_count
+
1
)
end
def
retry_count
registry
.
public_send
(
"
#{
type
}
_retry_count"
)
||
-
1
# rubocop:disable GitlabSecurity/PublicSend
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