Open ktjd123 opened 1 year ago
Might be related with https://github.com/seanmonstar/reqwest/issues/1215
Using below code works like charm (async reqwest
)
let start = SystemTime::now();
while true {
let client = reqwest::ClientBuilder::new()
.timeout(Duration::from_secs(5))
.tcp_keepalive(None)
.build()
.unwrap();
let result = match client
.get("https://fapi.binance.com/fapi/v1/trades?symbol=BTCBUSD")
.send()
.await
{
Ok(o) => o,
Err(e) => {
println!("{:?} : {:?}", e.status(), e);
continue;
}
};
println!(
"{} : {}, time duration is {}",
result.status(),
result.text().await.unwrap().len(),
SystemTime::now().duration_since(start).unwrap().as_secs()
);
}
Hi,
I'm having error with
FutureMarket.get_trades
.below is reproduce code
after about 20s ~ 50s from start, the function keep gives Timeout error, detailed error is
If I restart the program the code succeeds to fetch again so it doesn't seem to be rate limit related problem.
Thank you, Appreciate your works.