diff --git a/app/models/user.rb b/app/models/user.rb index 878c15043..d7db81462 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -241,8 +241,8 @@ class User < ApplicationRecord def cached_following_users_ids RedisRailsCache.fetch( - "user-#{id}-#{updated_at}-#{following_users_count}/following_users_ids", - expires_in: 120.hours, + "user-#{id}-#{last_followed_at}-#{following_users_count}/following_users_ids", + expires_in: 12.hours, ) do Follow.where(follower_id: id, followable_type: "User").limit(150).pluck(:followable_id) end @@ -250,8 +250,8 @@ class User < ApplicationRecord def cached_following_organizations_ids RedisRailsCache.fetch( - "user-#{id}-#{updated_at}-#{following_orgs_count}/following_organizations_ids", - expires_in: 120.hours, + "user-#{id}-#{last_followed_at}-#{following_orgs_count}/following_organizations_ids", + expires_in: 12.hours, ) do Follow.where(follower_id: id, followable_type: "Organization").limit(150).pluck(:followable_id) end @@ -259,8 +259,8 @@ class User < ApplicationRecord def cached_following_podcasts_ids RedisRailsCache.fetch( - "user-#{id}-#{updated_at}-#{last_followed_at}/following_podcasts_ids", - expires_in: 120.hours, + "user-#{id}-#{last_followed_at}/following_podcasts_ids", + expires_in: 12.hours, ) do Follow.where(follower_id: id, followable_type: "Podcast").pluck(:followable_id) end