Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
ecc58c0f
Commit
ecc58c0f
authored
6 years ago
by
Eugen Rochko
Browse files
Options
Download
Email Patches
Plain Diff
Prevent multiple handlers for Delete of Actor from running (#9292)
parent
6d4438a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/activitypub/activity.rb
+6
-0
app/lib/activitypub/activity.rb
app/lib/activitypub/activity/delete.rb
+4
-2
app/lib/activitypub/activity/delete.rb
with
10 additions
and
2 deletions
+10
-2
app/lib/activitypub/activity.rb
+
6
-
0
View file @
ecc58c0f
...
...
@@ -129,4 +129,10 @@ class ActivityPub::Activity
::
FetchRemoteStatusService
.
new
.
call
(
@object
[
'url'
])
end
end
def
lock_or_return
(
key
,
expire_after
=
7
.
days
.
seconds
)
yield
if
redis
.
set
(
key
,
true
,
nx:
true
,
ex:
expire_after
)
ensure
redis
.
del
(
key
)
end
end
This diff is collapsed.
Click to expand it.
app/lib/activitypub/activity/delete.rb
+
4
-
2
View file @
ecc58c0f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets