Sha256: 08fc2751b6846d73f3503296694bf5a1e78eac8b5940c00484b057cd45ee8a60
Contents?: true
Size: 1.07 KB
Versions: 17
Compression:
Stored size: 1.07 KB
Contents
require 'ddtrace/contrib/redis/vendor/resolver' module Datadog module Contrib module Redis module Configuration # Converts Symbols, Strings, and Hashes to a normalized connection settings Hash. class Resolver < Contrib::Configuration::Resolver def resolve(key_or_hash) return :default if key_or_hash == :default normalize(connection_resolver.resolve(key_or_hash)) end def normalize(hash) return { url: hash[:url] } if hash[:scheme] == 'unix' # Connexion strings are always converted to host, port, db and scheme # but the host, port, db and scheme will generate the :url only after # establishing a first connexion { host: hash[:host], port: hash[:port], db: hash[:db], scheme: hash[:scheme] } end def connection_resolver @connection_resolver ||= ::Datadog::Contrib::Redis::Vendor::Resolver.new end end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems