mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-07 04:59:49 +00:00
log & clippy
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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?;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user