Commit e09a5a90 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'sh-add-cursor-update-logging' into 'master'

Add structured log messages to Geo LogCursor

See merge request !2574
parents cf27ede3 1857a2c8
......@@ -45,7 +45,12 @@ module Gitlab
existing = ::Geo::ProjectRegistry.where(project_id: project_ids).pluck(:project_id)
missing_projects = project_ids - existing
Rails.logger.debug("Missing projects: #{missing_projects}")
Gitlab::Geo::Logger.debug(
class: self.class.name,
message: "Missing projects",
projects: missing_projects,
project_count: missing_projects.count)
missing_projects.each do |id|
::Geo::ProjectRegistry.create(project_id: id)
end
......@@ -91,6 +96,15 @@ module Gitlab
registry.resync_wiki = true
end
Gitlab::Geo::Logger.info(
class: self.class.name,
message: "Repository update",
cursor_delay_s: (Time.now - updated_event.created_at).to_f.round(3),
project_id: updated_event.project_id,
source: updated_event.source,
resync_repository: registry.resync_repository,
resync_wiki: registry.resync_wiki)
registry.save!
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