mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-07 13:09:46 +00:00
replace ttl with tti
This commit is contained in:
@@ -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)]
|
||||
pub struct DnsNodeMgrDirtyFlags {
|
||||
@@ -54,7 +54,7 @@ pub struct DnsNodeMgr {
|
||||
impl DnsNodeMgr {
|
||||
pub fn new() -> 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(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
pub struct DnsPeerMgrInner {
|
||||
@@ -145,7 +145,7 @@ pub struct DnsPeerMgr(Arc<DnsPeerMgrInner>);
|
||||
impl DnsPeerMgr {
|
||||
pub fn new(peer_mgr: Arc<PeerManager>, global_ctx: ArcGlobalCtx) -> Self {
|
||||
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(),
|
||||
peer_mgr,
|
||||
global_ctx,
|
||||
|
||||
Reference in New Issue
Block a user