Commit de2b8456 authored by Valery Sizov's avatar Valery Sizov

[Geo status node update] Add information about last pulled status to geo:status rake task

parent 05d37640
......@@ -211,7 +211,7 @@ namespace :geo do
task status: :environment do
abort GEO_LICENSE_ERROR_TEXT unless Gitlab::Geo.license_allows?
COLUMN_WIDTH = 35
COLUMN_WIDTH = 40
current_node_status = GeoNodeStatus.current_node_status
geo_node = current_node_status.geo_node
......@@ -265,5 +265,15 @@ namespace :geo do
print cursor_last_event_id
puts "(#{time_ago_in_words(Geo::EventLog.find_by(id: cursor_last_event_id)&.created_at)} ago)"
end
print 'Last status was pulled by primary node: '.rjust(COLUMN_WIDTH)
if current_node_status.updated_at
puts "#{time_ago_in_words(current_node_status.updated_at)} ago"
else
# Only primary node can create a status record in the database so if it's not exists
# we get not persistant AR record here.
puts "Never"
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