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

cache.rake « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 753a5a11070b9f9565b5d552c96d2119437df4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
namespace :cache do
  desc "GITLAB | Clear redis cache"
  task :clear => :environment do
    # 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