Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
##
# 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