log & clippy

This commit is contained in:
Luna Yao
2026-04-03 15:07:08 +02:00
parent cddf6abfa7
commit 23f63f1e4a
6 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -109,6 +109,6 @@ impl DnsGlobalCtxExt for GlobalCtx {
}
fn dns_iter_zones(&self) -> impl Iterator<Item = ZoneConfig> {
iter::once(self.dns_self_zone()).chain(self.config.get_dns().zones.into_iter())
iter::once(self.dns_self_zone()).chain(self.config.get_dns().zones)
}
}
+2
View File
@@ -237,8 +237,10 @@ impl DnsNode {
.scoped_client::<DnsNodeMgrRpcClientFactory<BaseController>>("".to_string())
.await?;
tracing::trace!(?request, "sending heartbeat");
let response = client.heartbeat(BaseController::default(), request).await?;
if response.resync {
tracing::trace!("resync requested by server, sending full snapshot");
client
.heartbeat(BaseController::default(), heartbeat.clone())
.await?;
+2
View File
@@ -18,6 +18,7 @@ use itertools::Itertools;
use moka::future::Cache;
use std::sync::Arc;
use std::time::Duration;
use tracing::instrument;
#[derive(Debug, Clone)]
pub struct DnsPeerInfo {
@@ -111,6 +112,7 @@ impl DnsPeerMgr {
self.dirty.notify_one();
}
#[instrument(skip(self), level = "trace", ret)]
async fn fetch(&self, peer_id: PeerId) -> anyhow::Result<DnsPeerInfo> {
self.peer_mgr
.get_peer_rpc_mgr()
+3 -3
View File
@@ -36,7 +36,7 @@ use tokio_util::sync::CancellationToken;
use tracing::{instrument, Instrument};
#[derive(Clone)]
struct DynamicCatalog {
pub struct DynamicCatalog {
inner: Arc<tokio::sync::RwLock<Catalog>>,
}
@@ -121,7 +121,7 @@ impl DnsServer {
) -> anyhow::Result<()> {
let listeners = listeners.into_iter().collect();
if &*self.listeners.read() == &listeners {
if *self.listeners.read() == listeners {
tracing::info!("listeners unchanged, no need to reload");
return Ok(());
}
@@ -169,7 +169,7 @@ impl DnsServer {
) -> anyhow::Result<()> {
let addresses = addresses.into_iter().collect();
if &*self.addresses.read() == &addresses {
if *self.addresses.read() == addresses {
tracing::info!("addresses unchanged, no need to reload");
return Ok(());
}
+1 -1
View File
@@ -77,7 +77,7 @@ impl ProxyCidrsMonitor {
pub fn start(self) -> ScopedTask<()> {
ScopedTask::from(tokio::spawn(async move {
let mut cur_proxy_cidrs = BTreeSet::new();
let mut last_update = None::<Instant>;
// let last_update = None::<Instant>;
loop {
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+1 -1
View File
@@ -492,7 +492,7 @@ impl NetworkConfig {
.parse()
.with_context(|| format!("failed to parse instance id: {:?}", self.instance_id))?,
);
self.hostname.as_ref().map(|n| cfg.set_hostname(n));
if let Some(n) = self.hostname.as_ref() { cfg.set_hostname(n) }
cfg.set_dhcp(self.dhcp.unwrap_or_default());
cfg.set_inst_name(self.network_name.clone().unwrap_or_default());