Merge remote-tracking branch 'parent/main' into upstream-20231116
This commit is contained in:
commit
0704829a9b
80 changed files with 1483 additions and 1117 deletions
|
@ -20,7 +20,7 @@ class FetchLinkCardService < BaseService
|
|||
@status = status
|
||||
@original_url = parse_urls
|
||||
|
||||
return if @original_url.nil? || @status.preview_cards.any? || !@status.account.link_preview?
|
||||
return if @original_url.nil? || @status.with_preview_card? || !@status.account.link_preview?
|
||||
|
||||
@url = @original_url.to_s
|
||||
|
||||
|
@ -63,9 +63,9 @@ class FetchLinkCardService < BaseService
|
|||
|
||||
def attach_card
|
||||
with_redis_lock("attach_card:#{@status.id}") do
|
||||
return if @status.preview_cards.any?
|
||||
return if @status.with_preview_card?
|
||||
|
||||
@status.preview_cards << @card
|
||||
PreviewCardsStatus.create(status: @status, preview_card: @card, url: @original_url)
|
||||
Rails.cache.delete(@status)
|
||||
Trends.links.register(@status)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue