Skip to content

Commit 24d8608

Browse files
committed
do not fail when timeout
1 parent c6501b0 commit 24d8608

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/routing/ic/route_provider.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use ic_bn_lib::ic_agent::agent::{
1414
};
1515
use ic_bn_lib_common::{principal, traits::Healthy};
1616
use tokio::time::{sleep, timeout};
17-
use tracing::info;
17+
use tracing::{info, warn};
1818
use url::Url;
1919

2020
use crate::{
@@ -98,13 +98,16 @@ pub async fn setup_route_provider(
9898
};
9999

100100
let wrapper = RouteProviderWrapper::new(route_provider.clone());
101-
timeout(Duration::from_secs(120), async {
101+
if timeout(Duration::from_secs(120), async {
102102
while !wrapper.healthy() {
103103
sleep(Duration::from_secs(1)).await;
104104
}
105105
})
106106
.await
107-
.map_err(|_| anyhow!("Route provider did not become healthy within 2 minutes"))?;
107+
.is_err()
108+
{
109+
warn!("Route provider did not become healthy within 2 minutes, continuing anyway");
110+
}
108111

109112
Ok(route_provider)
110113
}

0 commit comments

Comments
 (0)