mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 09:09:17 +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)]
|
#[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(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user