Add primary key to preview_cards_statuses join table (includes deduplication migration) (#25243)
This commit is contained in:
parent
a0fad5c8bb
commit
6b896b20cc
5 changed files with 93 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue