fix(Windows): 移除 wait_interface_show 的 10 秒硬超时,避免开机无网络时 TUN 接口未就绪导致实例停止 (#2500)

This commit is contained in:
ParkGarden
2026-08-17 19:13:14 +08:00
committed by GitHub
parent 636390ec38
commit 282cd92f2c
+7 -13
View File
@@ -242,19 +242,13 @@ impl IfConfiguerTrait for WindowsIfConfiger {
} }
async fn wait_interface_show(&self, name: &str) -> Result<(), Error> { async fn wait_interface_show(&self, name: &str) -> Result<(), Error> {
Ok( loop {
tokio::time::timeout(std::time::Duration::from_secs(10), async move { if let Some(idx) = Self::get_interface_index(name) {
loop { tracing::info!(?name, ?idx, "Interface found");
if let Some(idx) = Self::get_interface_index(name) { return Ok(());
tracing::info!(?name, ?idx, "Interface found"); }
break; tokio::time::sleep(std::time::Duration::from_millis(100)).await;
} }
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
}
Ok::<(), Error>(())
})
.await??,
)
} }
async fn set_mtu(&self, name: &str, mtu: u32) -> Result<(), Error> { async fn set_mtu(&self, name: &str, mtu: u32) -> Result<(), Error> {