mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
redis namespace get method changed
This commit is contained in:
parent
e7eb6d8a2d
commit
2f18163579
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue