0
0
Fork 0

Fix temporary network/remote server error prevent from interactions with remote accounts (#18161)

* Fix temporary network/remote server error prevent from interactions with remote accounts

* Fix and add tests
This commit is contained in:
Claire 2022-04-28 20:19:10 +02:00 committed by GitHub
parent 8284110c55
commit 84d991988e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -30,6 +30,11 @@ class ResolveURLService < BaseService
end
def process_url_from_db
if [500, 502, 503, 504, nil].include?(fetch_resource_service.response_code)
account = Account.find_by(uri: @url)
return account unless account.nil?
end
return unless @on_behalf_of.present? && [401, 403, 404].include?(fetch_resource_service.response_code)
# It may happen that the resource is a private toot, and thus not fetchable,