about summary refs log tree commit diff
path: root/app/services/resolve_url_service.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-28 20:19:10 +0200
committerGitHub <noreply@github.com>2022-04-28 20:19:10 +0200
commit84d991988eb076a7d83c771b3266f66f1c8a9754 (patch)
tree59642ee49c4f413b390dcb976a1d3de7216b981a /app/services/resolve_url_service.rb
parent8284110c55679b7ce7b3922cb0559620b03ca88c (diff)
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
Diffstat (limited to 'app/services/resolve_url_service.rb')
-rw-r--r--app/services/resolve_url_service.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/services/resolve_url_service.rb b/app/services/resolve_url_service.rb
index 5981e4d98..e2c745673 100644
--- a/app/services/resolve_url_service.rb
+++ b/app/services/resolve_url_service.rb
@@ -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,