mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-07 13:09:46 +00:00
client: remove DnsPeerMgrDirtyFlags
This commit is contained in:
@@ -61,7 +61,7 @@ impl DnsClient {
|
||||
rpc: &mut StandAloneClient<TcpTunnelConnector>,
|
||||
heartbeat: &mut HeartbeatRequest,
|
||||
) -> anyhow::Result<()> {
|
||||
let request = if heartbeat.snapshot.is_none() || self.mgr.dirty.peers.reset() {
|
||||
let request = if heartbeat.snapshot.is_none() || self.mgr.dirty.reset() {
|
||||
heartbeat.update(self.mgr.snapshot());
|
||||
heartbeat.clone()
|
||||
} else {
|
||||
|
||||
@@ -39,15 +39,10 @@ impl TryFrom<DnsExportConfig> for DnsPeerInfo {
|
||||
|
||||
const DNS_PEER_TTL: Duration = Duration::from_secs(3);
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct DnsPeerMgrDirtyFlags {
|
||||
pub(crate) peers: DirtyFlag,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deref)]
|
||||
pub struct DnsPeerMgr {
|
||||
peers: Cache<PeerId, DnsPeerInfo>,
|
||||
pub(super) dirty: DirtyState<DnsPeerMgrDirtyFlags>,
|
||||
pub(super) dirty: DirtyState<DirtyFlag>,
|
||||
|
||||
#[deref]
|
||||
mgr: Arc<PeerManager>,
|
||||
@@ -92,7 +87,7 @@ impl DnsPeerMgr {
|
||||
}
|
||||
};
|
||||
|
||||
self.dirty.peers.mark();
|
||||
self.dirty.mark();
|
||||
|
||||
match self.fetch(peer_id).await {
|
||||
Ok(info) => {
|
||||
|
||||
Reference in New Issue
Block a user