Skip to content

Commit 4a9ca2b

Browse files
ClearlyClairehiyuki2578
authored andcommitted
Move sending account Delete to anyone but the account's followers to the pull̀ queue (mastodon#10016)
1 parent 7949f9e commit 4a9ca2b

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

app/services/suspend_account_service.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ def distribute_delete_actor!
102102
ActivityPub::DeliveryWorker.push_bulk(delivery_inboxes) do |inbox_url|
103103
[delete_actor_json, @account.id, inbox_url]
104104
end
105+
106+
ActivityPub::LowPriorityDeliveryWorker.push_bulk(low_priority_delivery_inboxes) do |inbox_url|
107+
[delete_actor_json, @account.id, inbox_url]
108+
end
105109
end
106110

107111
def delete_actor_json
@@ -117,7 +121,11 @@ def delete_actor_json
117121
end
118122

119123
def delivery_inboxes
120-
Account.inboxes + Relay.enabled.pluck(:inbox_url)
124+
@delivery_inboxes ||= @account.followers.inboxes + Relay.enabled.pluck(:inbox_url)
125+
end
126+
127+
def low_priority_delivery_inboxes
128+
Account.inboxes - delivery_inboxes
121129
end
122130

123131
def associations_for_destruction
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
class ActivityPub::LowPriorityDeliveryWorker < ActivityPub::DeliveryWorker
4+
sidekiq_options queue: 'pull', retry: 8, dead: false
5+
end

0 commit comments

Comments
 (0)