fixed clear cache rake task + puts
This commit is contained in:
parent
db4150de8d
commit
fd8476fe9c
1 changed files with 3 additions and 1 deletions
|
|
@ -3,12 +3,14 @@ namespace :cache do
|
||||||
desc "Clear all caches"
|
desc "Clear all caches"
|
||||||
task :clear => :environment do
|
task :clear => :environment do
|
||||||
if RedisCache.configured?
|
if RedisCache.configured?
|
||||||
redis = Redis.redis_connection
|
redis = RedisCache.redis_connection
|
||||||
|
puts "Clearing Cache..."
|
||||||
redis.keys do |k|
|
redis.keys do |k|
|
||||||
if k.match(/^#{RedisCache.cache_prefix}/).present?
|
if k.match(/^#{RedisCache.cache_prefix}/).present?
|
||||||
redis.del(k)
|
redis.del(k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
puts "Done!"
|
||||||
else
|
else
|
||||||
puts "Redis Cache is not configured"
|
puts "Redis Cache is not configured"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue