mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Use a single long-lived RPC connection when authenticated
The prior system spawned a new connection per request to enable parallelism, yet kept hitting hyper::IncompleteMessages I couldn't track down. This attempts to resolve those by a long-lived socket. Halves the amount of requests per-authenticated RPC call, and accordingly is likely still better overall. I don't believe this is resolved yet but this is still worth pushing.
This commit is contained in:
@@ -171,7 +171,7 @@ impl Handles {
|
||||
// If the RPC server has yet to start, sleep for up to 60s until it does
|
||||
for _ in 0 .. 60 {
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
let Ok(client) = HttpRpc::new(rpc.clone()) else { continue };
|
||||
let Ok(client) = HttpRpc::new(rpc.clone()).await else { continue };
|
||||
if client.get_height().await.is_err() {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ async fn mint_and_burn_test() {
|
||||
Coin::Monero,
|
||||
1_000_000_000_000,
|
||||
ExternalAddress::new(
|
||||
serai_client::networks::monero::Address::new(monero_addr).unwrap().try_into().unwrap(),
|
||||
serai_client::networks::monero::Address::new(monero_addr).unwrap().into(),
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user