From d22b2b2d81eadb91a0f9f8990c4983b1adc97333 Mon Sep 17 00:00:00 2001 From: Darius Date: Tue, 19 Sep 2023 13:30:03 -0400 Subject: [PATCH] fix: Remove flag check --- extensions/warp-ipfs/src/store/discovery.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/extensions/warp-ipfs/src/store/discovery.rs b/extensions/warp-ipfs/src/store/discovery.rs index 2cee40a51..5c71f012a 100644 --- a/extensions/warp-ipfs/src/store/discovery.rs +++ b/extensions/warp-ipfs/src/store/discovery.rs @@ -2,10 +2,7 @@ use std::{ collections::{hash_map::Entry, HashMap, HashSet}, fmt::Debug, hash::Hash, - sync::{ - atomic::{AtomicBool, Ordering}, - Arc, - }, + sync::Arc, time::Duration, }; @@ -330,7 +327,6 @@ impl Discovery { #[derive(Clone)] pub struct DiscoveryEntry { ipfs: Ipfs, - discover: Arc, peer_id: PeerId, config: DiscoveryConfig, task: Arc>>>, @@ -364,7 +360,6 @@ impl DiscoveryEntry { ipfs: ipfs.clone(), peer_id, config, - discover: Arc::default(), task: Arc::default(), sender, relays, @@ -392,9 +387,7 @@ impl DiscoveryEntry { } } loop { - if entry.discover.load(Ordering::SeqCst) - && !ipfs.is_connected(peer_id).await.unwrap_or_default() - { + if !ipfs.is_connected(peer_id).await.unwrap_or_default() { match entry.config { // Used for provider. Doesnt do anything right now // TODO: Maybe have separate provider query in case