mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
make sure event is triggered when peer conn remove (#1507)
This commit is contained in:
@@ -226,6 +226,11 @@ impl Peer {
|
|||||||
// pritn on drop
|
// pritn on drop
|
||||||
impl Drop for Peer {
|
impl Drop for Peer {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
self.conns.retain(|_, conn| {
|
||||||
|
self.global_ctx
|
||||||
|
.issue_event(GlobalCtxEvent::PeerConnRemoved(conn.get_conn_info()));
|
||||||
|
false
|
||||||
|
});
|
||||||
self.shutdown_notifier.notify_one();
|
self.shutdown_notifier.notify_one();
|
||||||
tracing::info!("peer {} drop", self.peer_node_id);
|
tracing::info!("peer {} drop", self.peer_node_id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user