* when updating staleness of connection, skip validations

This commit is contained in:
Seth Call 2013-01-05 23:43:23 -06:00
parent ad989300d7
commit d505ae77eb
1 changed files with 5 additions and 3 deletions

View File

@ -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