diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-07-07 21:41:51 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-07-07 22:07:57 +0300 |
commit | 62fb1cd5a54f764e3dff7c4359ded9cbf9ea9555 (patch) | |
tree | f5992dc8a428c92ed239f8488f64c8efa0bfabf0 | |
parent | aff0e5e244aa0820802e15abbbdcd2433d87fc86 (diff) |
Make Geo::BaseSyncService#update_registry clearer
-rw-r--r-- | app/services/geo/base_sync_service.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/services/geo/base_sync_service.rb b/app/services/geo/base_sync_service.rb index f1d27a2dc3b..4dc7ebafa8a 100644 --- a/app/services/geo/base_sync_service.rb +++ b/app/services/geo/base_sync_service.rb @@ -54,15 +54,13 @@ module Geo log("Updating #{type} sync information") - attrs = {}.tap do |attrs| - 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 + attrs = {} + + attrs["last_#{type}_synced_at"] = started_at if started_at + + if finished_at + attrs["last_#{type}_successful_sync_at"] = finished_at + attrs["resync_#{type}"] = false end registry.update!(attrs) |