diff --git a/src/common.rs b/src/common.rs index b20a1b245..ab3e087a3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -668,11 +668,13 @@ pub async fn get_nat_type(ms_timeout: u64) -> i32 { crate::ipc::get_nat_type(ms_timeout).await } -// #[cfg(any(target_os = "android", target_os = "ios", feature = "cli"))] +// used for client to test which server is faster in case stop-servic=Y #[tokio::main(flavor = "current_thread")] async fn test_rendezvous_server_() { let servers = Config::get_rendezvous_servers(); - Config::reset_online(); + if servers.len() <= 1 { + return; + } let mut futs = Vec::new(); for host in servers { futs.push(tokio::spawn(async move { @@ -692,6 +694,7 @@ async fn test_rendezvous_server_() { })); } join_all(futs).await; + Config::reset_online(); } // #[cfg(any(target_os = "android", target_os = "ios", feature = "cli"))]