smarter clear cache to help tests

This commit is contained in:
Sam 2015-03-12 10:47:32 +11:00
parent c4c5c10ea0
commit fb41816003

View file

@ -69,10 +69,7 @@ class RandomTopicSelector
end
def self.clear_cache!
Category.select(:id).each do |c|
$redis.del cache_key(c)
end
$redis.del cache_key
$redis.keys('random_topic_cache*').each{|k| $redis.del k}
end
def self.cache_key(category=nil)