about summary refs log tree commit diff
path: root/app/lib/activitypub/activity
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-11-16 19:46:23 +0100
committerGitHub <noreply@github.com>2018-11-16 19:46:23 +0100
commit9311430ed7022e2e02fbd0b453adfc43356fdf9d (patch)
tree41705cfc836b279ff0d3e66e4655f26101326724 /app/lib/activitypub/activity
parent074960bb0fa59664c0ae1a35ef80301f5033700d (diff)
Prevent multiple handlers for Delete of Actor from running (#9292)
Diffstat (limited to 'app/lib/activitypub/activity')
-rw-r--r--app/lib/activitypub/activity/delete.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/lib/activitypub/activity/delete.rb b/app/lib/activitypub/activity/delete.rb
index 457047ac0..8270fed1b 100644
--- a/app/lib/activitypub/activity/delete.rb
+++ b/app/lib/activitypub/activity/delete.rb
@@ -12,8 +12,10 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
   private
 
   def delete_person
-    SuspendAccountService.new.call(@account)
-    @account.destroy!
+    lock_or_return("delete_in_progress:#{@account.id}") do
+      SuspendAccountService.new.call(@account)
+      @account.destroy!
+    end
   end
 
   def delete_note