Support single redis DB.

This commit is contained in:
Discourse application
2013-09-24 15:47:35 +03:00
parent 07d08b81c7
commit 0c8f6ba9a4
2 changed files with 58 additions and 3 deletions

View File

@ -63,9 +63,7 @@ class DiscourseRedis
puts "Check your redis.yml and make sure it has configuration for the environment you're trying to use.", ''
raise 'Redis config not found'
end
redis_store = ActiveSupport::Cache::RedisStore.new "redis://#{(':' + redis_config['password'] + '@') if redis_config['password']}#{redis_config['host']}:#{redis_config['port']}/#{redis_config['cache_db']}"
redis_store.options[:namespace] = -> { DiscourseRedis.namespace }
redis_store
ActiveSupport::Cache::RedisStore.new host:redis_config['host'], port:redis_config['port'], password:redis_config['password'], db:redis_config['db'], namespace:->{ DiscourseRedis.namespace + "_cache" }
end