Commit be0c6c27f08694d2a1885507b99f4b54c16f86ea
Exists in
master
and in
4 other branches
Merge pull request #4775 from globin/remote_cache_redis
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,7 +40,14 @@ Gitlab::Application.configure do | ||
| 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) |
| 41 | 41 | ||
| 42 | # Use a different cache store in production | 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 | # Enable serving of images, stylesheets, and JavaScripts from an asset server | 52 | # Enable serving of images, stylesheets, and JavaScripts from an asset server |
| 46 | # config.action_controller.asset_host = "http://assets.example.com" | 53 | # config.action_controller.asset_host = "http://assets.example.com" |