Permalink
Browse files

Recall the same method when an error is triggered during the connection

  • Loading branch information...
1 parent c43ccca commit 52892539848406204482f9febfa9c2a3d2334906 @vincentp vincentp committed Oct 30, 2012
Showing with 5 additions and 4 deletions.
  1. +3 −2 .rspec
  2. +2 −2 lib/massive_record/adapters/thrift/connection.rb
View
5 .rspec
@@ -1,2 +1,3 @@
---format p
---color
+--colour
+--drb
+-f d
@@ -75,7 +75,7 @@ def method_missing(method, *args)
rescue => e
if reconnect?(e)
reconnect!(e)
- client.send(method, *args) if client
+ send(method, *args) if client
else
raise e
end
@@ -95,7 +95,7 @@ def reconnect?(e)
def reconnect!(e)
close
- sleep 0.5
+ sleep 0.4
@transport = nil
@client = nil
open(:reconnecting => true, :reason => e.class)

0 comments on commit 5289253

Please sign in to comment.