summaryrefslogtreecommitdiff
path: root/config/application.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-18 16:55:19 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-18 16:55:19 +0100
commit9805fe1914f28693eb0be4f8c2d8377050dd2ebb (patch)
tree6518ccf969e1aef128fa0fc384733a0f3ea5b185 /config/application.rb
parent943bed68bc42d02246ddea63a25432d3aba709e7 (diff)
downloadgitlab-ce-9805fe1914f28693eb0be4f8c2d8377050dd2ebb.tar.gz
Use SCAN during 'rake cache:clear'cache-clear
This allows 'rake cache:clear' to delete millions of keys without choking. It requires Redis 2.8.0 or newer but we needed that already anyway.
Diffstat (limited to 'config/application.rb')
-rw-r--r--config/application.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb
index 1e9ec74cdbf..0d596ed22f5 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -6,6 +6,8 @@ I18n.config.enforce_available_locales = false
Bundler.require(:default, Rails.env)
module Gitlab
+ REDIS_CACHE_NAMESPACE = 'cache:gitlab'
+
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -89,7 +91,7 @@ module Gitlab
redis_config_hash[:path] = redis_uri.path
end
- redis_config_hash[:namespace] = 'cache:gitlab'
+ redis_config_hash[:namespace] = REDIS_CACHE_NAMESPACE
redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
config.cache_store = :redis_store, redis_config_hash