* when updating staleness of connection, skip validations
This commit is contained in:
parent
ad989300d7
commit
d505ae77eb
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue