From 2569a0ac3d8dae51ed6dae8d606cd27ce4904c2d Mon Sep 17 00:00:00 2001 From: jeffin sam Date: Tue, 5 Nov 2019 20:04:58 +0530 Subject: [PATCH] Move cached_followed_tags to redis (#4714) --- app/decorators/user_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb index 7791d4222..fdcbb57b8 100644 --- a/app/decorators/user_decorator.rb +++ b/app/decorators/user_decorator.rb @@ -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|