Move social_image cache to Redis (#4818)
This commit is contained in:
parent
e92b005d02
commit
da2fa608c2
1 changed files with 2 additions and 2 deletions
|
|
@ -32,9 +32,9 @@ module Articles
|
|||
attr_reader :article
|
||||
|
||||
def legacy_article_social_image
|
||||
cache_key = "article-social-img-#{article}-#{article.updated_at}-#{article.comments_count}"
|
||||
cache_key = "article-social-img-#{article}-#{article.updated_at.rfc3339}-#{article.comments_count}"
|
||||
|
||||
Rails.cache.fetch(cache_key, expires_in: 1.hour) do
|
||||
RedisRailsCache.fetch(cache_key, expires_in: 1.hour) do
|
||||
src = GeneratedImage.new(article).social_image
|
||||
return src if src.start_with? "https://res.cloudinary.com/"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue