mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-08 05:29:47 +00:00
utils: add DirtyState
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
use super::{utils::NameServerAddr, zone::Zone};
|
||||
use crate::common::PeerId;
|
||||
use super::utils::NameServerAddr;
|
||||
use crate::dns::client_mgr::DnsClientMgr;
|
||||
use cidr::Ipv4Inet;
|
||||
use derivative::Derivative;
|
||||
use derive_more::{Deref, DerefMut, From, Into};
|
||||
use hickory_proto::rr::Record;
|
||||
@@ -20,9 +18,8 @@ use std::{sync::Arc, time::Duration};
|
||||
use tokio::net::{TcpListener, UdpSocket};
|
||||
use tokio::{sync::RwLock, task::JoinHandle};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use crate::dns::peer_mgr::DnsPeerMgr;
|
||||
use crate::peers::peer_manager::PeerManager;
|
||||
use crate::proto::dns::{DnsClientMgrRpcServer, DnsPeerMgrRpcServer};
|
||||
use crate::proto::dns::DnsClientMgrRpcServer;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DynamicCatalog {
|
||||
@@ -214,7 +211,7 @@ impl DnsServer {
|
||||
let dirty = &self.mgr.dirty;
|
||||
let mut runtime = None;
|
||||
loop {
|
||||
dirty.notified().await;
|
||||
dirty.notify.notified().await;
|
||||
|
||||
if dirty.catalog.reset() {
|
||||
self.catalog.replace(self.mgr.catalog()).await;
|
||||
@@ -231,7 +228,7 @@ impl DnsServer {
|
||||
{
|
||||
tracing::error!("failed to reload listeners: {:?}", e);
|
||||
dirty.listeners.mark();
|
||||
dirty.notify_one();
|
||||
dirty.notify.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user