Move cached_followed_tags to redis (#4714)
This commit is contained in:
parent
71b144da8d
commit
2569a0ac3d
1 changed files with 1 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ class UserDecorator < ApplicationDecorator
|
|||
delegate_all
|
||||
|
||||
def cached_followed_tags
|
||||
Rails.cache.fetch("user-#{id}-#{updated_at}/followed_tags_11-30", expires_in: 20.hours) do
|
||||
RedisRailsCache.fetch("user-#{id}-#{updated_at}/followed_tags_11-30", expires_in: 20.hours) do
|
||||
follows_query = Follow.where(follower_id: id, followable_type: "ActsAsTaggableOn::Tag").pluck(:followable_id, :points)
|
||||
tags = Tag.where(id: follows_query.map { |f| f[0] }).order("hotness_score DESC")
|
||||
tags.each do |t|
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue