lib/ruboty/slack_rtm/client.rb in ruboty-slack_rtm-3.2.0 vs lib/ruboty/slack_rtm/client.rb in ruboty-slack_rtm-3.2.1

- old
+ new

@@ -63,10 +63,16 @@ def keep_connection Thread.start do loop do sleep(30) - @client.send('', type: 'ping') + begin + @client.send('', type: 'ping') + rescue => e + Ruboty.logger.error("#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}") + @queue.enq(CONNECTION_CLOSED) + break + end end end end end end