Skip to content

Commit

Permalink
Merge pull request #40 from koshigoe/fix/no-reaction
Browse files Browse the repository at this point in the history
Enable to expect reconnect when exception occurred in Thread
  • Loading branch information
rosylilly authored Oct 14, 2019
2 parents 040541f + f41be85 commit 7dfd53c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ruboty/slack_rtm/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ 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
Expand Down

0 comments on commit 7dfd53c

Please sign in to comment.