BigW Consortium Gitlab

Commit 68e4a682 by Dmitriy Zaporozhets

Merge branch 'gitlab_cache_clear' into 'master'

Patch `rake cache:clear` for large amounts of keys
parents 33177866 cf0a3702
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment