diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index 802aa9cb5..fd966afeb 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -4,7 +4,7 @@ class SocketsController < ApplicationController include Rails.application.routes.url_helpers def incoming(msg) - puts "Got a connection to: #{msg}" + Rails.logger.info("Socket received connection to: #{msg}") end def outgoing(uid,object) diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index 0f4e68f7b..381d1f6c2 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -12,7 +12,7 @@ require "lib/diaspora/websocket" sid = Diaspora::WebSocket.subscribe(ws.request['Path'].gsub('/',''), ws) - ws.onmessage { |msg| SocketsController.new.incoming(msg) }#@channel.push msg; puts msg} + ws.onmessage { |msg| SocketsController.new.incoming(msg) } ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) } } diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 4bc54b4c9..8f97e53c3 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -31,8 +31,9 @@ class MessageHandler end http.errback { - puts http.response - puts "failure from #{query.destination}, retrying" + Rails.logger.info(http.response) + Rails.logger.info("Failure from #{query.destination}, retrying...") + query.try_count +=1 @queue.push query unless query.try_count >= NUM_TRIES process