Permalink
Browse files

+ simply remove the method if it's not a realtime (index instantly ch…

…anged) Redis backend
  • Loading branch information...
1 parent af5bc74 commit 5f4f9af5a297fdc93c251d99b2bbdbc000984817 @floere committed Sep 7, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 server/lib/picky/backends/redis.rb
@@ -169,22 +169,26 @@ def ids combinations, amount, offset
require 'digest/sha1'
@@ids_sent_once = nil
- # Scripting version of #ids.
+ # Overrides _this_ method.
#
extend Scripting
else
+ # Overrides _this_ method.
+ #
extend NonScripting
end
- # Call the newly installed version.
- #
- ids combinations, amount, offset
else
- # Simply super call.
+ # Remove _this_ method and use the super
+ # class method from now on.
#
- # TODO Remove the ids method.
+ # Note: This fails if there are multiple
+ # Redis backends with different versions.
#
- super
+ self.class.send :remove_method, __method__
end
+ # Call the newly installed / super class version.
+ #
+ ids combinations, amount, offset
end
# Generate a multiple host/process safe result id.

0 comments on commit 5f4f9af

Please sign in to comment.