Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola committed May 14, 2024
1 parent ab11095 commit 261b153
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions integration-tests/zombienet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ pub async fn wait_subxt_client(
) -> Result<OnlineClient<PolkadotConfig>, anyhow::Error> {
log::trace!("trying to connect to: {}", node.ws_uri());
loop {
match node.client::<PolkadotConfig>().await {
Ok(cli) => {
log::trace!("returning client for: {}", node.ws_uri());
return Ok(cli);
},
Err(e) => {
log::trace!("{e:?}");
if let subxt::Error::Rpc(subxt::error::RpcError::ClientError(ref inner)) = e {
log::trace!("inner: {inner}");
if inner.to_string().contains("i/o error") {
// The node is not ready to accept connections yet
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
continue;
}
match node.client::<PolkadotConfig>().await {
Ok(cli) => {
log::trace!("returning client for: {}", node.ws_uri());
return Ok(cli);
},
Err(e) => {
log::trace!("{e:?}");
if let subxt::Error::Rpc(subxt::error::RpcError::ClientError(ref inner)) = e {
log::trace!("inner: {inner}");
if inner.to_string().contains("i/o error") {
// The node is not ready to accept connections yet
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
continue;
}
return Err(anyhow!("Cannot connect to node : {e:?}"));
},
};
}
return Err(anyhow!("Cannot connect to node : {e:?}"));
},
};
}
}

0 comments on commit 261b153

Please sign in to comment.