aboutsummaryrefslogtreecommitdiffstats
path: root/worker_node/lib/user_connection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'worker_node/lib/user_connection.rb')
-rw-r--r--worker_node/lib/user_connection.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/worker_node/lib/user_connection.rb b/worker_node/lib/user_connection.rb
index 83c030a..2457d4f 100644
--- a/worker_node/lib/user_connection.rb
+++ b/worker_node/lib/user_connection.rb
@@ -12,11 +12,10 @@ class UserConnection
end
def update(hash)
- if hash[:oauth_token] == @client.options[:oauth_token]
- log(:debug, "Token is not changed")
- else
- @client.update(hash)
+ if @client.update_if_necessary(hash)
log(:info, "Updated connection")
+ else
+ log(:debug, "Token is not changed")
end
end
@@ -129,7 +128,6 @@ class UserConnection
end
def on_delete(json, timestamp = nil)
- timestamp ||= json[:timestamp_ms]
log(:debug, "Delete: #{json[:delete][:status]}")
EventChannel << { event: :delete,
identifier: "delete-#{json[:delete][:status][:id]}",