refactor(service): simplify DNS override sync and runtime asset staging

This commit is contained in:
wonfen
2026-11-03 09:34:16 +08:00
parent bcbb5e3a58
commit 5b7e876ab0
14 changed files with 41 additions and 108 deletions
-2
View File
@@ -59,7 +59,6 @@ pub async fn change_clash_core(clash_core: std::string::String) -> CmdResult<Opt
match CoreManager::global().change_core(&clash_core).await {
Ok(_) => {
logging_error!(Type::Config, Config::sync_dns_override().await);
logging_error!(Type::Core, profiles_save_file_safe().await);
match CoreManager::global().restart_core().await {
@@ -206,7 +205,6 @@ pub async fn apply_dns_config(apply: bool) -> CmdResult {
logging!(info, Type::Config, "Config regenerated successfully");
}
logging_error!(Type::Config, Config::sync_dns_override().await);
handle::Handle::refresh_clash();
Ok(())
}
-5
View File
@@ -191,10 +191,6 @@ pub async fn delete_profile(index: std::string::String) -> CmdResult {
drop(config_update_guard);
drop(profile_write_guard);
if should_update {
logging_error!(Type::Config, Config::sync_dns_override().await);
}
if let Err(e) = Tray::global().update_tooltip().await {
logging!(warn, Type::Cmd, "异步更新托盘提示失败: {e:#}");
}
@@ -264,7 +260,6 @@ async fn handle_success(current_value: Option<&String>) -> CmdResult<ValidationO
handle::Handle::notify_profile_changed(current);
}
logging_error!(Type::Config, Config::sync_dns_override().await);
Ok(ValidationOutcome::Valid)
}
+1 -2
View File
@@ -10,7 +10,7 @@ use crate::{
},
utils::dirs,
};
use clash_verge_logging::{Type, logging, logging_error};
use clash_verge_logging::{Type, logging};
use smartstring::alias::String;
use tokio::fs;
@@ -168,7 +168,6 @@ async fn handle_saved_profile_file(
);
match CoreManager::global().update_config_forced().await {
Ok(outcome) if outcome.is_valid() => {
logging_error!(Type::Config, Config::sync_dns_override().await);
handle::Handle::refresh_clash();
Ok(ValidationOutcome::Valid)
}