Commit 15628706 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre 🌴

Group related log messages on Geo::RepositoryBackfillService

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