about summary refs log tree commit diff
path: root/app/services/suspend_account_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-14 18:01:35 +0200
committerGitHub <noreply@github.com>2017-06-14 18:01:35 +0200
commite17c2e5da5010beaefb46c8fffe35e87cb28f407 (patch)
tree5044d517e80ea2e152621da3520992648bcca42b /app/services/suspend_account_service.rb
parent4a618908e836ecb94f70e99f2198ee7b3ba3b2ec (diff)
Batched remove status service (#3735)
* Make Pubsubhubbub::DistributionWorker handle both single stream entry
arguments, as well as arrays of stream entries

* Add BatchedRemoveStatusService, make SuspendAccountService use it

* Improve method names

* Add test

* Add more tests

* Use PuSH payloads of 100 to have a clear mapping of
1000 input statuses -> 10 PuSH payloads

It was nice while it lasted
Diffstat (limited to 'app/services/suspend_account_service.rb')
-rw-r--r--app/services/suspend_account_service.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 842500259..1e3a51e4e 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -17,9 +17,8 @@ class SuspendAccountService < BaseService
   end
 
   def purge_content
-    @account.statuses.reorder(nil).find_each do |status|
-      # This federates out deletes to previous followers
-      RemoveStatusService.new.call(status)
+    @account.statuses.reorder(nil).find_in_batches do |statuses|
+      BatchedRemoveStatusService.new.call(statuses)
     end
 
     [