mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-17 07:50:33 +08:00
fix(tun): avoid service IPC startup race on Windows (#6340)
* fix(tun): avoid service IPC startup race on Windows * docs: Changelog.md * style: prettier
This commit is contained in:
parent
700011688b
commit
1bf445ddcc
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
### 🐞 修复问题
|
### 🐞 修复问题
|
||||||
|
|
||||||
|
- 修复 Windows 管理员身份运行时开关 TUN 模式异常
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
<summary><strong> ✨ 新增功能 </strong></summary>
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
## v2.4.5
|
## v2.4.5
|
||||||
|
|
||||||
- **Mihomo(Meta) 内核升级至 v1.19.19**
|
- **Mihomo(Meta) 内核升级至 v1.19.19**
|
||||||
|
|||||||
@ -83,7 +83,7 @@ impl CoreManager {
|
|||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
async fn wait_for_service_if_needed(&self) {
|
async fn wait_for_service_if_needed(&self) {
|
||||||
use crate::{config::Config, constants::timing};
|
use crate::{config::Config, constants::timing, core::service};
|
||||||
use backoff::{Error as BackoffError, ExponentialBackoff};
|
use backoff::{Error as BackoffError, ExponentialBackoff};
|
||||||
|
|
||||||
let needs_service = Config::verge().await.latest_arc().enable_tun_mode.unwrap_or(false);
|
let needs_service = Config::verge().await.latest_arc().enable_tun_mode.unwrap_or(false);
|
||||||
@ -108,6 +108,12 @@ impl CoreManager {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the service IPC path is not ready yet, treat it as transient and retry.
|
||||||
|
// Running init/refresh too early can mark service state unavailable and break later config reloads.
|
||||||
|
if !service::is_service_ipc_path_exists() {
|
||||||
|
return Err(BackoffError::transient(anyhow::anyhow!("Service IPC not ready")));
|
||||||
|
}
|
||||||
|
|
||||||
manager.init().await.map_err(BackoffError::transient)?;
|
manager.init().await.map_err(BackoffError::transient)?;
|
||||||
let _ = manager.refresh().await;
|
let _ = manager.refresh().await;
|
||||||
|
|
||||||
|
|||||||
@ -11,14 +11,9 @@
|
|||||||
"icons/icon.icns",
|
"icons/icon.icns",
|
||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
"resources": [
|
"resources": ["resources"],
|
||||||
"resources"
|
|
||||||
],
|
|
||||||
"publisher": "Clash Verge Rev",
|
"publisher": "Clash Verge Rev",
|
||||||
"externalBin": [
|
"externalBin": ["sidecar/verge-mihomo", "sidecar/verge-mihomo-alpha"],
|
||||||
"sidecar/verge-mihomo",
|
|
||||||
"sidecar/verge-mihomo-alpha"
|
|
||||||
],
|
|
||||||
"copyright": "GNU General Public License v3.0",
|
"copyright": "GNU General Public License v3.0",
|
||||||
"category": "DeveloperTool",
|
"category": "DeveloperTool",
|
||||||
"shortDescription": "Clash Verge Rev",
|
"shortDescription": "Clash Verge Rev",
|
||||||
@ -47,25 +42,17 @@
|
|||||||
},
|
},
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
"desktop": {
|
"desktop": {
|
||||||
"schemes": [
|
"schemes": ["clash", "clash-verge"]
|
||||||
"clash",
|
|
||||||
"clash-verge"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"security": {
|
"security": {
|
||||||
"capabilities": [
|
"capabilities": ["desktop-capability", "migrated"],
|
||||||
"desktop-capability",
|
|
||||||
"migrated"
|
|
||||||
],
|
|
||||||
"assetProtocol": {
|
"assetProtocol": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"scope": {
|
"scope": {
|
||||||
"allow": [
|
"allow": ["**"],
|
||||||
"**"
|
|
||||||
],
|
|
||||||
"requireLiteralLeadingDot": false
|
"requireLiteralLeadingDot": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user