move has-pro-membership cache to redis (#4691)
This commit is contained in:
parent
78f1eb2b11
commit
c7e0ce0275
2 changed files with 2 additions and 2 deletions
|
|
@ -56,6 +56,6 @@ class ProMembership < ApplicationRecord
|
|||
end
|
||||
|
||||
def bust_cache
|
||||
Rails.cache.delete("user-#{user.id}/has_pro_membership")
|
||||
RedisRailsCache.delete("user-#{user.id}/has_pro_membership")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ class User < ApplicationRecord
|
|||
end
|
||||
|
||||
def pro?
|
||||
Rails.cache.fetch("user-#{id}/has_pro_membership", expires_in: 200.hours) do
|
||||
RedisRailsCache.fetch("user-#{id}/has_pro_membership", expires_in: 200.hours) do
|
||||
pro_membership&.active? || has_role?(:pro)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue