Commit 6107479d authored by Robert Speicher's avatar Robert Speicher

Merge branch 'geo-base-sync-service' into 'master'

Geo - Remove unnecessary param from Geo::BaseSyncService#update_registry

See merge request !2735
parents 1267a221 c87f86ef
...@@ -65,7 +65,7 @@ module Geo ...@@ -65,7 +65,7 @@ module Geo
Gitlab::ExclusiveLease.cancel(lease_key, repository_lease) Gitlab::ExclusiveLease.cancel(lease_key, repository_lease)
end end
def update_registry(type, started_at: nil, finished_at: nil) def update_registry(started_at: nil, finished_at: nil)
return unless started_at || finished_at return unless started_at || finished_at
log_info("Updating #{type} sync information") log_info("Updating #{type} sync information")
......
...@@ -11,17 +11,17 @@ module Geo ...@@ -11,17 +11,17 @@ module Geo
def fetch_project_repository def fetch_project_repository
log_info('Fetching project repository') log_info('Fetching project repository')
update_registry(:repository, started_at: DateTime.now) update_registry(started_at: DateTime.now)
begin begin
project.ensure_repository project.ensure_repository
project.repository.fetch_geo_mirror(ssh_url_to_repo) project.repository.fetch_geo_mirror(ssh_url_to_repo)
update_registry(:repository, finished_at: DateTime.now) update_registry(finished_at: DateTime.now)
rescue Gitlab::Shell::Error, Geo::EmptyCloneUrlPrefixError => e rescue Gitlab::Shell::Error, Geo::EmptyCloneUrlPrefixError => e
log_error("Error syncing repository", e) log_error('Error syncing repository', e)
rescue Gitlab::Git::Repository::NoRepository => e rescue Gitlab::Git::Repository::NoRepository => e
log_error("Invalid repository", e) log_error('Invalid repository', e)
log_info('Expiring caches') log_info('Expiring caches')
project.repository.after_create project.repository.after_create
end end
......
...@@ -10,18 +10,18 @@ module Geo ...@@ -10,18 +10,18 @@ module Geo
def fetch_wiki_repository def fetch_wiki_repository
log_info('Fetching wiki repository') log_info('Fetching wiki repository')
update_registry(:wiki, started_at: DateTime.now) update_registry(started_at: DateTime.now)
begin begin
project.wiki.ensure_repository project.wiki.ensure_repository
project.wiki.repository.fetch_geo_mirror(ssh_url_to_wiki) project.wiki.repository.fetch_geo_mirror(ssh_url_to_wiki)
update_registry(:wiki, finished_at: DateTime.now) update_registry(finished_at: DateTime.now)
rescue Gitlab::Git::Repository::NoRepository, rescue Gitlab::Git::Repository::NoRepository,
Gitlab::Shell::Error, Gitlab::Shell::Error,
ProjectWiki::CouldNotCreateWikiError, ProjectWiki::CouldNotCreateWikiError,
Geo::EmptyCloneUrlPrefixError => e Geo::EmptyCloneUrlPrefixError => e
log_error("Error syncing wiki repository", e) log_error('Error syncing wiki repository', e)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment