Commit 2b904cb34fcc9408b49e866976eaa7e82f032184
1 parent
b6fdca9c
Exists in
master
and in
4 other branches
Fix caching when using remote redis server
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
config/environments/production.rb
... | ... | @@ -40,7 +40,14 @@ Gitlab::Application.configure do |
40 | 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) |
41 | 41 | |
42 | 42 | # Use a different cache store in production |
43 | - config.cache_store = :redis_store | |
43 | + config_file = Rails.root.join('config', 'resque.yml') | |
44 | + | |
45 | + resque_url = if File.exists?(config_file) | |
46 | + YAML.load_file(config_file)[Rails.env] | |
47 | + else | |
48 | + "redis://localhost:6379" | |
49 | + end | |
50 | + config.cache_store = :redis_store, resque_url | |
44 | 51 | |
45 | 52 | # Enable serving of images, stylesheets, and JavaScripts from an asset server |
46 | 53 | # config.action_controller.asset_host = "http://assets.example.com" | ... | ... |