Module: Kredis::Connections
- Included in:
- Kredis
- Defined in:
- lib/kredis/connections.rb
Instance Method Summary collapse
Instance Method Details
#clear_all ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# 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) ⇒ Object
7 8 9 10 11 12 13 |
# 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 |