lib/cachetastic/cache.rb in cachetastic-3.0.4 vs lib/cachetastic/cache.rb in cachetastic-3.0.5

- old
+ new

@@ -166,25 +166,26 @@ return yield(key) if block_given? end end def retryable(options = {}, &block) - opts = { :tries => 2, :on => Exception }.merge(options) + opts = { :tries => 3, :on => Exception }.merge(options) retries = opts[:tries] retry_exceptions = [opts[:on]].flatten x = %{ begin return yield rescue #{retry_exceptions.join(", ")} => e retries -= 1 if retries > 0 + clear_adapter! retry else raise e end - end + end } eval(x, &block) end \ No newline at end of file