Permalink
Browse files

reconnect 15 min laster after receive max reconnect error

  • Loading branch information...
siuying committed Oct 11, 2010
1 parent 08c36da commit d7f1d3c7b359164687e746ff79cf911448ccde29
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/reflect/reflect.rb
View
@@ -57,7 +57,15 @@ def listen
end
stream.on_max_reconnects do |timeout, retries|
- @logger.error "max reconnects reached"
+ @logger.error "max reconnects reached: timeout: #{timeout}, retries: #{retries}"
+
+ # reconnect after 15 minutes
+ stream.stop
+ sleep(900)
+ stream = Twitter::JSONStream.connect(
+ :path => "/1/statuses/filter.json?follow=#{@user_id}",
+ :auth => @twitter_auth
+ )
end
trap('TERM') {

0 comments on commit d7f1d3c

Please sign in to comment.