Skip to content

Commit c9fbac3

Browse files
committed
feat: error rising on endpoint online timeout
1 parent 400c42c commit c9fbac3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,10 @@ async fn create_endpoint(
355355
}
356356
let endpoint = builder.bind().await?;
357357

358-
if !(common.relay == RelayModeOption::Disabled) {
359-
let _ = tokio::time::timeout(Duration::from_secs(5), endpoint.online()).await;
360-
};
358+
if !(common.relay == RelayModeOption::Disabled)
359+
&& tokio::time::timeout(Duration::from_secs(5), endpoint.online()).await.is_err() {
360+
eprintln!("Error waiting for relay connection (timeout)");
361+
};
361362

362363
Ok(endpoint)
363364
}

0 commit comments

Comments
 (0)