mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-06 09:02:08 +08:00
fix: preserve custom TUN fields and sync service provider caches
Limit GUI authority to saved TUN fields while preserving custom overrides. Sync provider caches after service startup, reloads and updates. Publish copies atomically with session, runtime and cache metadata checks.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
use super::{CmdResult, proxy_aware_coded_error};
|
||||
use crate::core::{
|
||||
CoreManager,
|
||||
service::{SERVICE_MANAGER, ServiceStatus},
|
||||
use crate::{
|
||||
constants::timing,
|
||||
core::{
|
||||
CoreManager,
|
||||
manager::RunningMode,
|
||||
service::{SERVICE_MANAGER, ServiceStatus, request_runtime_provider_sync},
|
||||
},
|
||||
};
|
||||
|
||||
async fn execute_service_operation_sync(status: ServiceStatus, error_code: &str) -> CmdResult {
|
||||
@@ -52,3 +56,10 @@ pub async fn continue_with_sidecar() -> CmdResult {
|
||||
.await
|
||||
.map_err(|error| proxy_aware_coded_error(&error, "SERVICE_SIDECAR_FAILED"))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn sync_runtime_providers() {
|
||||
if matches!(*CoreManager::global().get_running_mode(), RunningMode::Service) {
|
||||
request_runtime_provider_sync(timing::RUNTIME_PROVIDER_SETTLE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user