Module: Moped::Failover::Retry
Overview
Retry is for the case when we get exceptions around the connection, and want to make another attempt to try and resolve the issue.
Instance Method Summary collapse
-
#execute(exception, node) ⇒ Object
Executes the failover strategy.
Instance Method Details
#execute(exception, node) ⇒ Object
Executes the failover strategy. In the case of retyr, we disconnect and reconnect, then try the operation one more time.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/moped/failover/retry.rb', line 26 def execute(exception, node) node.disconnect begin node.connection do |conn| yield(conn) if block_given? end rescue Exception => e node.down! raise(e) end end |