module Kredis::Connections

Public Instance Methods

clear_all() click to toggle source
# File lib/kredis/connections.rb, line 15
def clear_all
  Kredis.instrument :meta, message: "Connections all cleared" do
    connections.each_value do |connection|
      if Kredis.namespace
        keys = connection.keys("#{Kredis.namespace}:*")
        connection.del keys if keys.any?
      else
        connection.flushdb
      end
    end
  end
end
configured_for(name) click to toggle source
# File lib/kredis/connections.rb, line 7
def configured_for(name)
  connections[name] ||= begin
    Kredis.instrument :meta, message: "Connected to #{name}" do
      Redis.new configurator.config_for("redis/#{name}")
    end
  end
end