mirror of
https://github.com/mastodon/mastodon.git
synced 2025-02-01 06:51:44 +01:00
Change activity distribution error handling to skip retrying for deleted accounts (#33617)
This commit is contained in:
parent
febdfefafe
commit
092e60eb7d
@ -62,7 +62,7 @@ class ActivityPub::DeliveryWorker
|
||||
stoplight_wrapper.run do
|
||||
request_pool.with(@host) do |http_client|
|
||||
build_request(http_client).perform do |response|
|
||||
raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response)
|
||||
raise Mastodon::UnexpectedResponseError, response unless response_successful?(response) || response_error_unsalvageable?(response) || unsalvageable_authorization_failure?(response)
|
||||
|
||||
@performed = true
|
||||
end
|
||||
@ -70,6 +70,10 @@ class ActivityPub::DeliveryWorker
|
||||
end
|
||||
end
|
||||
|
||||
def unsalvageable_authorization_failure?(response)
|
||||
@source_account.permanently_unavailable? && response.code == 401
|
||||
end
|
||||
|
||||
def stoplight_wrapper
|
||||
Stoplight(@inbox_url)
|
||||
.with_threshold(STOPLIGHT_FAILURE_THRESHOLD)
|
||||
|
Loading…
x
Reference in New Issue
Block a user