Avoid redundant HTTP request on some error cases (#10115)

signup-info-prompt
ThibG 2019-02-25 15:54:17 +01:00 committed by Eugen Rochko
parent 16fb39cffc
commit 9dd54ffb1c
1 changed files with 1 additions and 0 deletions

View File

@ -68,6 +68,7 @@ module JsonLdHelper
return body_to_json(response.body_with_limit) if response.code == 200 return body_to_json(response.body_with_limit) if response.code == 200
end end
# If request failed, retry without doing it on behalf of a user # If request failed, retry without doing it on behalf of a user
return if on_behalf_of.nil?
build_request(uri).perform do |response| build_request(uri).perform do |response|
response.code == 200 ? body_to_json(response.body_with_limit) : nil response.code == 200 ? body_to_json(response.body_with_limit) : nil
end end