This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Raise Mastodon::RaceConditionError if Redis lock failed (
#7511
)
An explicit error allows user agents to know the error and Sidekiq to retry.
pull/4/head
Akihiko Odaki
6 years ago
committed by
Eugen Rochko
parent
65d6b253fb
commit
55fd55714a
6 changed files
with
12 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-0
app/controllers/media_proxy_controller.rb
+2
-0
app/lib/activitypub/activity/create.rb
+2
-0
app/lib/ostatus/activity/creation.rb
+2
-0
app/services/activitypub/process_account_service.rb
+2
-0
app/services/fetch_link_card_service.rb
+2
-0
app/services/resolve_account_service.rb
+ 2
- 0
app/controllers/media_proxy_controller.rb
View File
@ -8,6 +8,8 @@ class MediaProxyController < ApplicationController
if
lock
.
acquired?
@media_attachment
=
MediaAttachment
.
remote
.
find
(
params
[
:id
]
)
redownload!
if
@media_attachment
.
needs_redownload?
&&
!
reject_media?
else
raise
Mastodon
::
RaceConditionError
end
end
+ 2
- 0
app/lib/activitypub/activity/create.rb
View File
@ -11,6 +11,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
if
lock
.
acquired?
@status
=
find_existing_status
process_status
if
@status
.
nil?
else
raise
Mastodon
::
RaceConditionError
end
end
+ 2
- 0
app/lib/ostatus/activity/creation.rb
View File
@ -15,6 +15,8 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
@status
=
find_status
(
id
)
return
[
@status
,
false
]
unless
@status
.
nil?
@status
=
process_status
else
raise
Mastodon
::
RaceConditionError
end
end
+ 2
- 0
app/services/activitypub/process_account_service.rb
View File
@ -23,6 +23,8 @@ class ActivityPub::ProcessAccountService < BaseService
create_account
if
@account
.
nil?
update_account
process_tags
else
raise
Mastodon
::
RaceConditionError
end
end
+ 2
- 0
app/services/fetch_link_card_service.rb
View File
@ -23,6 +23,8 @@ class FetchLinkCardService < BaseService
if
lock
.
acquired?
@card
=
PreviewCard
.
find_by
(
url
:
@url
)
process_url
if
@card
.
nil?
||
@card
.
updated_at
<
=
2
.
weeks
.
ago
else
raise
Mastodon
::
RaceConditionError
end
end
+ 2
- 0
app/services/resolve_account_service.rb
View File
@ -49,6 +49,8 @@ class ResolveAccountService < BaseService
else
handle_ostatus
end
else
raise
Mastodon
::
RaceConditionError
end
end
Write
Preview
Loading…
Cancel
Save