* VRFS-798 - close connection if a heartbeat can not be correlated to a connection, or memory state
This commit is contained in:
parent
aff6df7028
commit
550a1ae6df
|
|
@ -92,7 +92,6 @@
|
|||
function loggedIn(header, payload) {
|
||||
app.clientId = payload.client_id;
|
||||
$.cookie('client_id', payload.client_id);
|
||||
// $.cookie('remember_token', payload.token); // removed per vrfs-273/403
|
||||
|
||||
heartbeatMS = payload.heartbeat_interval * 1000;
|
||||
logger.debug("jamkazam.js.loggedIn(): clientId now " + app.clientId + "; Setting up heartbeat every " + heartbeatMS + " MS");
|
||||
|
|
|
|||
|
|
@ -538,11 +538,13 @@ module JamWebsockets
|
|||
unless context = @clients[client]
|
||||
@log.warn "*** WARNING: unable to find context due to heartbeat from client: #{client.client_id}; calling cleanup"
|
||||
cleanup_client(client)
|
||||
raise SessionError, 'context state is gone. please reconnect.'
|
||||
else
|
||||
connection = Connection.find_by_user_id_and_client_id(context.user.id, context.client.client_id)
|
||||
if connection.nil?
|
||||
@log.warn "*** WARNING: unable to find connection due to heartbeat from client: #{context}; calling cleanup_client"
|
||||
cleanup_client(client)
|
||||
raise SessionError, 'connection state is gone. please reconnect.'
|
||||
else
|
||||
connection.touch
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue