Skip to content

Commit

Permalink
Optimize RemoveStatusService by removing n+1 query and using shared i…
Browse files Browse the repository at this point in the history
…nboxes (mastodon#10247)
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent e068f0e commit bdc3c2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/services/remove_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def call(status, **options)
@account = status.account
@tags = status.tags.pluck(:name).to_a
@mentions = status.active_mentions.includes(:account).to_a
@reblogs = status.reblogs.to_a
@reblogs = status.reblogs.includes(:account).to_a
@stream_entry = status.stream_entry
@options = options

Expand Down Expand Up @@ -77,8 +77,8 @@ def remove_from_remote_affected
end

# ActivityPub
ActivityPub::DeliveryWorker.push_bulk(target_accounts.select(&:activitypub?).uniq(&:inbox_url)) do |target_account|
[signed_activity_json, @account.id, target_account.inbox_url]
ActivityPub::DeliveryWorker.push_bulk(target_accounts.select(&:activitypub?).uniq(&:preferred_inbox_url)) do |target_account|
[signed_activity_json, @account.id, target_account.preferred_inbox_url]
end
end

Expand Down

0 comments on commit bdc3c2e

Please sign in to comment.