Group related log messages on Geo::RepositoryBackfillService

parent 99373c0d
...@@ -12,14 +12,17 @@ module Geo ...@@ -12,14 +12,17 @@ module Geo
def execute def execute
try_obtain_lease do try_obtain_lease do
log('Started repository sync')
fetch_repositories do |started_at, finished_at| fetch_repositories do |started_at, finished_at|
log('Tracking sync information') log('Tracking sync information')
registry = Geo::ProjectRegistry.find_or_create_by(project_id: project.id) registry = Geo::ProjectRegistry.find_or_create_by(project_id: project.id)
registry.last_repository_synced_at = started_at registry.last_repository_synced_at = started_at
registry.last_repository_successful_sync_at = finished_at if finished_at registry.last_repository_successful_sync_at = finished_at if finished_at
registry.save registry.save
log('Finished repository sync')
end end
log('Finished repository sync')
end end
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
logger.error("Couldn't find project with ID=#{project_id}, skipping syncing") logger.error("Couldn't find project with ID=#{project_id}, skipping syncing")
...@@ -37,8 +40,6 @@ module Geo ...@@ -37,8 +40,6 @@ module Geo
started_at = DateTime.now started_at = DateTime.now
finished_at = nil finished_at = nil
log('Started repository sync')
begin begin
project.create_repository unless project.repository_exists? project.create_repository unless project.repository_exists?
project.repository.after_create if project.empty_repo? project.repository.after_create if project.empty_repo?
......
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