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
6d9fd6d5
Commit
6d9fd6d5
authored
Nov 28, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor wiki service
parent
f5b63600
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
app/services/geo/wiki_sync_service.rb
app/services/geo/wiki_sync_service.rb
+12
-5
No files found.
app/services/geo/wiki_sync_service.rb
View file @
6d9fd6d5
...
...
@@ -32,12 +32,12 @@ module Geo
Gitlab
::
Shell
::
Error
,
ProjectWiki
::
CouldNotCreateWikiError
,
Geo
::
EmptyCloneUrlPrefixError
=>
e
log_error
(
'Error syncing wiki repository'
,
e
)
registry
.
increment!
(
:wiki_retry_count
)
fail_registry
(
'Error syncing wiki repository'
,
e
)
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
log_error
(
'Invalid wiki'
,
e
)
registry
.
update
(
force_to_redownload_wiki:
true
,
wiki_retry_count:
retry_count
+
1
)
fail_registry
(
'Invalid wiki'
,
e
)
log_info
(
'Setting force_to_redownload flag'
)
registry
.
update
(
force_to_redownload_wiki:
true
,)
ensure
clean_up_temporary_repository
if
redownload
end
...
...
@@ -50,6 +50,13 @@ module Geo
project
.
wiki
.
repository
end
def
fail_registry
(
message
,
error
)
log_error
(
message
,
error
)
registry
.
update!
(
last_wiki_sync_failure:
"
#{
message
}
:
#{
error
.
message
}
"
,
wiki_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