fix: Tun disable failed due to too short timeout

This commit is contained in:
oomeow 2025-11-09 13:09:32 +08:00
parent 2f7b3bb9a0
commit ba1b9796e8
No known key found for this signature in database
GPG Key ID: A5B4ACC4A88A1282

View File

@ -57,13 +57,8 @@ pub async fn clean_async() -> bool {
let disable_tun = serde_json::json!({ "tun": { "enable": false } });
#[cfg(target_os = "windows")]
let tun_timeout = Duration::from_millis(100);
#[cfg(not(target_os = "windows"))]
let tun_timeout = Duration::from_millis(100);
match timeout(
tun_timeout,
Duration::from_millis(1000),
handle::Handle::mihomo()
.await
.patch_base_config(&disable_tun),