redis namespace get method changed

This commit is contained in:
Kyle Drake 2022-11-06 16:45:03 +00:00
parent e7eb6d8a2d
commit 2f18163579

View file

@ -24,7 +24,7 @@ class Tag < Sequel::Model
def self.popular_names(limit=10)
cache_key = "tag_popular_names_#{limit}".to_sym
cache = $redis_cache[cache_key]
cache = $redis_cache.get cache_key
if cache.nil?
res = DB["select tags.name,count(*) as c from sites_tags inner join tags on tags.id=sites_tags.tag_id where tags.name != '' and tags.is_nsfw='f' group by tags.name having count(*) > 1 order by c desc LIMIT ?", limit].all
$redis_cache.set cache_key, res.to_msgpack