mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-30 15:59:21 +00:00
fix(Windows): 移除 wait_interface_show 的 10 秒硬超时,避免开机无网络时 TUN 接口未就绪导致实例停止 (#2500)
This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user