From c388f9e169a73242027ad7d446998f10cbf5ce4b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 8 Oct 2012 21:26:06 -0400 Subject: [PATCH] fixed bug --- lib/jam_websockets/router.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jam_websockets/router.rb b/lib/jam_websockets/router.rb index c07c1ebd0..e9fd58e1d 100644 --- a/lib/jam_websockets/router.rb +++ b/lib/jam_websockets/router.rb @@ -84,8 +84,10 @@ module JamWebsockets routing_key = headers.envelope.routing_key user_id = routing_key["user.".length..-1] @sempahore.synchronize do + @log.debug "USER ID = #{user_id}" contexts = @user_context_lookup[user_id] + @log.debug "CONTEXT = #{contexts}" unless contexts.nil? @log.debug "received user-directed message for user: #{user_id}" @@ -507,7 +509,7 @@ 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.user_id, context.client.client_id) + connection = Connection.find_by_user_id_and_client_id(context.user.id, context.client.client_id) unless connection.nil? connection.updated_at = DateTime.now