async-http-faraday
async-http-faraday copied to clipboard
Stuck on some sites
class Otc
def conn
@conn ||= Faraday.new(url: 'https://www.htx.com') do |builder|
builder.adapter :async_http, timeout: 60
builder.request :json
builder.response :json
end
end
def payment_systems_request
@payment_systems_request ||=
conn.get('/-/x/otc/v1/data/config-list', { type: 'currency,marketQuery,pay,allCountry,coin' }).body
end
end
[1] pry(main)> hb = Otc.new
[2] pry(main)> hb.send(:payment_systems_request)
Faraday::TimeoutError: execution expired (Faraday::TimeoutError)
But it is actually ok with other sites. Can not find out which side to dig from. It's also ok with default adapter.