lib/rapnd/daemon.rb in rapnd-0.4.1 vs lib/rapnd/daemon.rb in rapnd-0.5.0

- old
+ new

@@ -19,10 +19,13 @@ options[:password] ||= '' raise 'No cert provided!' unless options[:cert] Airbrake.configure { |config| config.api_key = options[:airbrake]; @airbrake = true; } if options[:airbrake] - @redis = Redis.new(:host => options[:redis_host], :port => options[:redis_port]) + redis_options = { :host => options[:redis_host], :port => options[:redis_port] } + redis_options[:password] = options[:redis_password] if options.has_key?(:redis_password) + + @redis = Redis.new(redis_options) @queue = options[:queue] @cert = options[:cert] @host = options[:host] @logger = Logger.new("#{options[:dir]}/log/#{options[:queue]}.log") @logger.info "Listening on queue: #{self.queue}" \ No newline at end of file