diff --git a/Cargo.lock b/Cargo.lock index 758a23f..154394e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ dependencies = [ [[package]] name = "chia-seeder-light" -version = "0.1.5" +version = "0.1.6" dependencies = [ "anyhow", "async-channel", diff --git a/Cargo.toml b/Cargo.toml index 1285daa..fd044d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chia-seeder-light" -version = "0.1.5" +version = "0.1.6" edition = "2021" [dependencies] diff --git a/src/config.rs b/src/config.rs index 1a9f151..b84a3e1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,5 +4,5 @@ pub const PEER_TIMEOUT: u64 = 7; pub const DNS_RECORD_TTL: u32 = 300; pub const MAX_CONCURRENT_TASKS: usize = 100; pub const MAX_RECORDS_TO_RETURN: usize = 32; -pub const RECHECK_INTERVAL: Duration = Duration::from_secs(1800); +pub const RECHECK_INTERVAL: Duration = Duration::from_secs(900); pub const PEER_BLOCKLIST_TTL: u64 = 86400; diff --git a/src/peer.rs b/src/peer.rs index 565e8dd..9e7d2e5 100644 --- a/src/peer.rs +++ b/src/peer.rs @@ -190,10 +190,10 @@ pub async fn start_peer_rechecker( ) -> anyhow::Result<()> { let processor = PeerProcessor::new(tls, authority.clone(), network_id, true); + sleep(RECHECK_INTERVAL).await; + loop { - sleep(RECHECK_INTERVAL).await; let peers = authority.get_peers().await; - info!( "Starting periodic peer recheck, checking {} reachable peers", peers.len() @@ -204,5 +204,7 @@ pub async fn start_peer_rechecker( for peer in peers { processor.process(peer); } + + sleep(RECHECK_INTERVAL).await; } }