diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-12 22:34:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-12 22:34:55 +0100 |
commit | a41afef80c03df0aa64158a538920a2f68bea044 (patch) | |
tree | 76fff0d77e5ea07b8df091144bd0fba30e748308 /app | |
parent | 5b50c2cbaa75a07b5f665a0d55cbfd79de67cc63 (diff) |
Optimize RemoveStatusService by removing n+1 query and using shared inboxes (#10247)
Diffstat (limited to 'app')
-rw-r--r-- | app/services/remove_status_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb index 2012f15fc..98875429d 100644 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@ -10,7 +10,7 @@ class RemoveStatusService < BaseService @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 @@ -77,8 +77,8 @@ class RemoveStatusService < BaseService 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 |