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 end
def self.clear_cache! def self.clear_cache!
Category.select(:id).each do |c| $redis.keys('random_topic_cache*').each{|k| $redis.del k}
$redis.del cache_key(c)
end
$redis.del cache_key
end end
def self.cache_key(category=nil) def self.cache_key(category=nil)