mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-06 09:02:08 +08:00
refactor(service): simplify DNS override sync and runtime asset staging
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user