lib/envoy/client/trunk.rb in envoy-proxy-0.0.9 vs lib/envoy/client/trunk.rb in envoy-proxy-0.0.10

- old
+ new

@@ -51,13 +51,13 @@ EventMachine.stop_event_loop end def unbind if r = @options[:reconnect] - STDERR.puts "Lost connection. Reconnecting in #{r[0]}s." - EM.add_timer r[0] do - @options[:reconnect] = [r[1], r[0] + r[1]] + STDERR.write "Lost connection. Retrying... #{r[0]}\r" + EM.add_timer 0.5 do + @options[:reconnect] = r.rotate Trunk.start @options end else if options[:did_connect] STDERR.puts "Connection lost. Not point reconnecting because the host is randomly generated." @@ -68,10 +68,10 @@ end end def ssl_handshake_completed options[:did_connect] = true - options[:reconnect] = [0, 1] if options[:hosts] + options[:reconnect] = %w"- \\ | /" if options[:hosts] o = options.dup o.delete(:local_host) send_object :options, o end \ No newline at end of file