I feel like no matter how much I throttle my requests I hit this error: Net::OpenTimeout: Net::OpenTimeout
.
This is what my request looks like. Is there something I can do so I can stop timing out? My client has an open timeout of 500 milliseconds. I’ve also put it all the way up to 60 seconds. No matter what I am getting timed out. Can someone please help me with this please?
SOULTION: If anyone else runs into this, the fix is to rescue the timeout, in ruby, you would do this with a begin rescue block.
class PartyClient
include HTTParty
open_timeout 0.5
end
begin
url = "https://us.api.blizzard.com/profile/wow/character/#{character.realm.downcase}/#{character.name.downcase}/equipment?namespace=profile-us&locale=en_US"
uri = URI.parse(url)
response = PartyClient.get(uri, headers: {Authorization: "bearer #{@character_token}", Connection: 'close'})
response["equipped_items"]
rescue URI::InvalidURIError
puts 'woops'
end