Refactor Geo::BaseSyncService#update_registry

parent 010d58e8
...@@ -50,16 +50,18 @@ module Geo ...@@ -50,16 +50,18 @@ module Geo
log("Updating #{type} sync information") log("Updating #{type} sync information")
if started_at attrs = {}.tap do |attrs|
registry.public_send("last_#{type}_synced_at=", started_at) if started_at
attrs["last_#{type}_synced_at"] = started_at
end
if finished_at
attrs["last_#{type}_successful_sync_at"] = finished_at
attrs["resync_#{type}"] = false
end
end end
if finished_at registry.update!(attrs)
registry.public_send("last_#{type}_successful_sync_at=", finished_at)
registry.public_send("resync_#{type}=", false)
end
registry.save!
end end
def lease_key def lease_key
......
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