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