Commit 107ee352 authored by Tobias H. Michaelsen's avatar Tobias H. Michaelsen
Browse files

Simplified Redis connection creation

Redis-rb has a built in URL parser, which also handles specifying db # etc.
parent 96d3b2e6
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -47,10 +47,7 @@ module FnordMetric
  end

  def self.mk_redis
    host, port = options[:redis_url].gsub("redis://", "").split(":")
    redis_opts = { :host => host }
    redis_opts.merge!(:port => port) if port
    Redis.new(redis_opts)
    Redis.new(:url => options[:redis_url])
  end

  def self.default_options(opts = {})