lib/flapjack/configuration.rb in flapjack-0.6.39 vs lib/flapjack/configuration.rb in flapjack-0.6.40
- old
+ new
@@ -54,10 +54,18 @@
next if config_env['redis'].has_key?(k) && (config_env['redis'][k] &&
!(config_env['redis'][k].is_a?(String) && config_env['redis'][k].empty?))
config_env['redis'][k] = v
end
- config_env
+ redis_path = (config_env['redis']['path'] || nil)
+ base_opts = {:db => (config_env['redis']['db'] || 0)}
+ redis_config = base_opts.merge(
+ (redis_path ? { :path => redis_path } :
+ { :host => (config_env['redis']['host'] || '127.0.0.1'),
+ :port => (config_env['redis']['port'] || 6379)})
+ )
+
+ return config_env, redis_config
end
end
end