Change activity distribution error handling to skip retrying for deleted accounts (#33617)

This commit is contained in:
Claire 2025-01-17 10:12:59 +01:00 committed by GitHub
parent febdfefafe
commit 092e60eb7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)