replace ttl with tti

This commit is contained in:
Luna Yao
2026-04-06 11:55:25 +02:00
parent 67108d14b0
commit 4dad60a94d
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ impl TryFrom<&DnsSnapshot> for DnsNodeInfo {
} }
} }
const DNS_CLIENT_TTL: Duration = Duration::from_secs(5); const DNS_NODE_TTI: Duration = Duration::from_secs(5);
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct DnsNodeMgrDirtyFlags { pub struct DnsNodeMgrDirtyFlags {
@@ -54,7 +54,7 @@ pub struct DnsNodeMgr {
impl DnsNodeMgr { impl DnsNodeMgr {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
nodes: Cache::builder().time_to_live(DNS_CLIENT_TTL).build(), nodes: Cache::builder().time_to_idle(DNS_NODE_TTI).build(),
dirty: Default::default(), dirty: Default::default(),
} }
} }
+2 -2
View File
@@ -39,7 +39,7 @@ impl TryFrom<DnsExportConfig> for DnsPeerInfo {
} }
} }
const DNS_PEER_TTL: Duration = Duration::from_secs(3); const DNS_PEER_TTI: Duration = Duration::from_secs(3);
#[derive(Debug)] #[derive(Debug)]
pub struct DnsPeerMgrInner { pub struct DnsPeerMgrInner {
@@ -145,7 +145,7 @@ pub struct DnsPeerMgr(Arc<DnsPeerMgrInner>);
impl DnsPeerMgr { impl DnsPeerMgr {
pub fn new(peer_mgr: Arc<PeerManager>, global_ctx: ArcGlobalCtx) -> Self { pub fn new(peer_mgr: Arc<PeerManager>, global_ctx: ArcGlobalCtx) -> Self {
Self(Arc::new(DnsPeerMgrInner { Self(Arc::new(DnsPeerMgrInner {
peers: Cache::builder().time_to_live(DNS_PEER_TTL).build(), peers: Cache::builder().time_to_idle(DNS_PEER_TTI).build(),
dirty: Default::default(), dirty: Default::default(),
peer_mgr, peer_mgr,
global_ctx, global_ctx,