Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-06-20 15:58:57 +0400
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-06-20 15:58:57 +0400
commitcf0a3702741d2bdf0fd2aa7637d7394314eefba5 (patch)
tree8f0a883a1d7cb4853b2bcf2067f3c4a842fc658c /lib/tasks
parent995d193d32c96a608435f232f67efcaf48cba67c (diff)
Patch `rake cache:clear` for large amounts of keys
Diffstat (limited to 'lib/tasks')
-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