mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-18 16:30:32 +08:00
fix: Tun disable failed due to too short timeout
This commit is contained in:
parent
2f7b3bb9a0
commit
ba1b9796e8
@ -57,13 +57,8 @@ pub async fn clean_async() -> bool {
|
|||||||
|
|
||||||
let disable_tun = serde_json::json!({ "tun": { "enable": false } });
|
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(
|
match timeout(
|
||||||
tun_timeout,
|
Duration::from_millis(1000),
|
||||||
handle::Handle::mihomo()
|
handle::Handle::mihomo()
|
||||||
.await
|
.await
|
||||||
.patch_base_config(&disable_tun),
|
.patch_base_config(&disable_tun),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user