From d505ae77eb8171f595e72df04595b9d573bc4536 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 5 Jan 2013 23:43:23 -0600 Subject: [PATCH] * when updating staleness of connection, skip validations --- lib/jam_websockets/router.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jam_websockets/router.rb b/lib/jam_websockets/router.rb index 86d31a958..f68d0094f 100644 --- a/lib/jam_websockets/router.rb +++ b/lib/jam_websockets/router.rb @@ -479,12 +479,14 @@ module JamWebsockets def handle_heartbeat(heartbeat, client) context = @clients[client] - @log.debug "updating timestamp for user #{context}" connection = Connection.find_by_user_id_and_client_id(context.user.id, context.client.client_id) - unless connection.nil? + if connection.nil? + @log.debug "unable to find connection due to heartbeat from client: #{context}" + else + @log.debug "updating connection freshness due to heartbeat from client: #{context}" connection.updated_at = DateTime.now - connection.save + connection.save(:validate => false) # validates are unneeded, as we are just touching updated_at end end