Browse Source

dht, fud: remove disconnect_task

epiphany 1 year ago
parent
commit
0c69ae0d22
1 changed files with 0 additions and 17 deletions
  1. 0 17
      src/dht/handler.rs

+ 0 - 17
src/dht/handler.rs

@@ -100,7 +100,6 @@ pub trait DhtHandler {
                 continue;
             }
 
-            sleep(1).await;
             let ping_res = self.ping(channel.clone()).await;
 
             if let Err(e) = ping_res {
@@ -125,22 +124,6 @@ pub trait DhtHandler {
         }
     }
 
-    /// Remove disconnected nodes from the channel cache
-    async fn disconnect_task(&self) -> Result<()> {
-        loop {
-            sleep(15).await;
-
-            let channel_cache_lock = self.dht().channel_cache.clone();
-            let mut channel_cache = channel_cache_lock.write().await;
-            for (channel_id, _) in channel_cache.clone() {
-                let channel = self.dht().p2p.get_channel(channel_id);
-                if channel.is_none() {
-                    channel_cache.remove(&channel_id);
-                }
-            }
-        }
-    }
-
     /// Add a node in the correct bucket
     async fn add_node(&self, node: DhtNode) {
         // Do not add ourselves to the buckets