We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8d9e1c commit e014a0bCopy full SHA for e014a0b
config/initializers/redis.rb
@@ -1,5 +1,11 @@
1
# config/initializers/redis.rb
2
redis_config = YAML.load_file(Rails.root + 'config/redis.yml')[Rails.env]
3
-$redis = Redis::Namespace.new(redis_config['namespace'], redis: Redis.new(host: redis_config['host'], port: redis_config['port']))
+redis = Redis.new(host: redis_config['host'], port: redis_config['port'])
4
+if ENV["REDISCLOUD_URL"]
5
+ uri = URI.parse(ENV["REDISCLOUD_URL"])
6
+ redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
7
+end
8
+$redis = Redis::Namespace.new(redis_config['namespace'], redis: redis)
9
+
10
11
0 commit comments