mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-26 07:22:30 +00:00
Avoid redundant HTTP request on some error cases (#10115)
This commit is contained in:
parent
1219e463f9
commit
04197a2745
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue