Skip to content

Commit 522bc18

Browse files
committed
Removes redis.rb
1 parent 14cfd1d commit 522bc18

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

config/environments/development.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@
6767
Gon.global.APP_ASSET_HOST = ENV['APP_ASSET_HOST']
6868
Gon.global.PUBLIC_ASSET_HOST = ENV['PUBLIC_ASSET_HOST']
6969

70-
ENV["REDISTOGO_URL"] = 'redis://redistogo:[email protected]:9060/'
70+
#ENV["REDISTOGO_URL"] = 'redis://redistogo:[email protected]:9060/'
71+
if ENV["REDISTOGO_URL"]
72+
uri = URI.parse(ENV["REDISTOGO_URL"])
7173

72-
end
74+
config.cache_store = [
75+
:redis_store, {
76+
:host => uri.host,
77+
:port => uri.port,
78+
:password => uri.password,
79+
:namespace => "cache"
80+
}
81+
]
82+
end
83+
end

config/environments/production.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@
5252
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
5353

5454
# Use a different cache store in production.
55-
config.cache_store = :redis_store
55+
if ENV["REDISTOGO_URL"]
56+
uri = URI.parse(ENV["REDISTOGO_URL"])
57+
58+
config.cache_store = [
59+
:redis_store, {
60+
:host => uri.host,
61+
:port => uri.port,
62+
:password => uri.password,
63+
:namespace => "cache"
64+
}
65+
]
66+
end
5667

5768
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
5869
# config.action_controller.asset_host = "http://assets.example.com"

config/initializers/redis.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)