fix(dns): save the DNS override decision on every runtime replacement

Refs #8431
This commit is contained in:
wonfen
2026-11-03 09:34:16 +08:00
parent 726b2b362f
commit bcbb5e3a58
8 changed files with 53 additions and 11 deletions
+7 -1
View File
@@ -6,6 +6,7 @@ use serde_yaml_ng::{Mapping, Value};
use sha2::{Digest as _, Sha256};
use smartstring::alias::String;
use std::sync::atomic::{AtomicBool, Ordering};
use tokio::sync::MutexGuard;
use super::{Config, IVerge};
use crate::core::handle::Handle;
@@ -128,7 +129,12 @@ impl IVerge {
impl Config {
pub(crate) async fn sync_dns_override() -> Result<()> {
let _config_write = Self::lock_config_write().await;
let config_write = Self::lock_config_write().await;
Self::sync_dns_override_locked(&config_write).await
}
/// Callers must have ended their own draft transaction, which claims the same Verge layer.
pub(crate) async fn sync_dns_override_locked(_config_write: &MutexGuard<'_, ()>) -> Result<()> {
let state = Self::runtime().await.data_arc().dns_override.clone();
let Some(state) = state else {
return Ok(());