Permalink
Browse files

Add Risky.riak!

  • Loading branch information...
1 parent 6a253fb commit 670e3f915e3c7faa639880e1952821e1f5640013 @aphyr committed May 17, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/risky.rb
View
@@ -254,6 +254,14 @@ def self.riak
end
end
+ # Forces this model and thread's Riak client to be reset.
+ # If your @riak proc can choose between multiple hosts, calling this on
+ # failure will allow subsequent requests to proceed on another host.
+ def self.riak!
+ Thread.current["self.riak"] = nil
+ riak
+ end
+
# Sets the Riak Client backing this model class. If client is a lambda (or
# anything responding to #call), it will be invoked to generate a new client
# every time Risky feels it is appropriate. Clients are stored in

0 comments on commit 670e3f9

Please sign in to comment.