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
77723c05
Commit
77723c05
authored
Feb 16, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backfill wiki repositories
parent
8f05852c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
app/services/geo/repository_backfill_service.rb
app/services/geo/repository_backfill_service.rb
+17
-3
No files found.
app/services/geo/repository_backfill_service.rb
View file @
77723c05
...
...
@@ -10,7 +10,7 @@ module Geo
def
execute
try_obtain_lease
do
synchronize
do
|
started_at
,
finished_at
|
fetch_repositories
do
|
started_at
,
finished_at
|
registry
=
Geo
::
ProjectRegistry
.
find_or_create_by
(
project_id:
project
.
id
)
registry
.
last_repository_synced_at
=
started_at
registry
.
last_repository_successful_sync_at
=
finished_at
if
finished_at
...
...
@@ -21,7 +21,7 @@ module Geo
private
def
synchronize
def
fetch_repositories
started_at
=
DateTime
.
now
finished_at
=
nil
...
...
@@ -29,6 +29,12 @@ module Geo
project
.
create_repository
unless
project
.
repository_exists?
project
.
repository
.
after_create
if
project
.
empty_repo?
project
.
repository
.
fetch_geo_mirror
(
ssh_url_to_repo
)
# Second .wiki call returns a Gollum::Wiki, and it will always create the physical repository when not found
if
project
.
wiki_enabled?
&&
project
.
wiki
.
wiki
.
exist?
project
.
wiki
.
repository
.
fetch_geo_mirror
(
ssh_url_to_wiki
)
end
project
.
repository
.
expire_all_method_caches
project
.
repository
.
expire_branch_cache
project
.
repository
.
expire_content_cache
...
...
@@ -59,8 +65,16 @@ module Geo
@key
||=
"repository_backfill_service:
#{
project
.
id
}
"
end
def
primary_ssh_path_prefix
Gitlab
::
Geo
.
primary_ssh_path_prefix
end
def
ssh_url_to_repo
"
#{
Gitlab
::
Geo
.
primary_ssh_path_prefix
}#{
project
.
path_with_namespace
}
.git"
"
#{
primary_ssh_path_prefix
}#{
project
.
path_with_namespace
}
.git"
end
def
ssh_url_to_wiki
"
#{
primary_ssh_path_prefix
}#{
project
.
path_with_namespace
}
.wiki.git"
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