0
0
Fork 0

Add primary key to preview_cards_statuses join table (includes deduplication migration) (#25243)

This commit is contained in:
Claire 2023-08-03 11:12:52 +02:00 committed by GitHub
parent a0fad5c8bb
commit 6b896b20cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 5 deletions

View file

@ -61,9 +61,13 @@ class FetchLinkCardService < BaseService
end
def attach_card
@status.preview_cards << @card
Rails.cache.delete(@status)
Trends.links.register(@status)
with_redis_lock("attach_card:#{@status.id}") do
return if @status.preview_cards.any?
@status.preview_cards << @card
Rails.cache.delete(@status)
Trends.links.register(@status)
end
end
def parse_urls