summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-23 06:39:20 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-23 06:39:20 +0000
commit68e4a68223f76cfa27bc55c5bcc822e3b5097007 (patch)
treeed690bc1036d6d921b2632cfdad893ffd16f2d58
parent331778664be8f9ca2591dedd01676464a4849f30 (diff)
parentcf0a3702741d2bdf0fd2aa7637d7394314eefba5 (diff)
downloadgitlab-ce-68e4a68223f76cfa27bc55c5bcc822e3b5097007.tar.gz
Merge branch 'gitlab_cache_clear' into 'master'
Patch `rake cache:clear` for large amounts of keys
-rw-r--r--lib/tasks/cache.rake7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/tasks/cache.rake b/lib/tasks/cache.rake
index 8320b9b2576..753a5a11070 100644
--- a/lib/tasks/cache.rake
+++ b/lib/tasks/cache.rake
@@ -1,6 +1,11 @@
namespace :cache do
desc "GITLAB | Clear redis cache"
task :clear => :environment do
- Rails.cache.clear
+ # Hack into Rails.cache until https://github.com/redis-store/redis-store/pull/225
+ # is accepted (I hope) and we can update the redis-store gem.
+ redis_store = Rails.cache.instance_variable_get(:@data)
+ redis_store.keys.each_slice(1000) do |key_slice|
+ redis_store.del(*key_slice)
+ end
end
end