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")
attrs = {}.tap do |attrs|
if started_at if started_at
registry.public_send("last_#{type}_synced_at=", started_at) attrs["last_#{type}_synced_at"] = started_at
end end
if finished_at if finished_at
registry.public_send("last_#{type}_successful_sync_at=", finished_at) attrs["last_#{type}_successful_sync_at"] = finished_at
registry.public_send("resync_#{type}=", false) attrs["resync_#{type}"] = false
end
end end
registry.save! registry.update!(attrs)
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