Created
February 21, 2010 12:25
-
-
Save superfeedr/310288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# We slightly modify The redis library so that it doesn't fail when the server is not there | |
# if this happens, filtering will not go through for this specific feed. But will work for other feeds | |
# using othe redis caches, which is good. | |
# Our app then just gas to rescue ProtocolError and act upon that. | |
module EventMachine | |
module Protocols | |
module Redis | |
def call_command(argv, &blk) | |
raise ProtocolError if error?() | |
callback { raw_call_command(argv, &blk) } | |
end | |
def unbind | |
puts "*** unbinding" if $debug | |
if @connected or @reconnecting | |
EM.add_timer(1) do | |
reconnect @host, @port | |
auth @current_password if @current_password | |
select @current_database if @current_database | |
end | |
@connected = false | |
@reconnecting = true | |
@deferred_status = nil | |
else | |
# raise 'Unable to connect to redis server' | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment