Skip to content

Commit

Permalink
wait until interval
Browse files Browse the repository at this point in the history
  • Loading branch information
denisu committed Nov 5, 2024
1 parent 2ff7c50 commit 6194b2b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chia-seeder-light"
version = "0.1.5"
version = "0.1.6"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 4 additions & 2 deletions src/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -204,5 +204,7 @@ pub async fn start_peer_rechecker(
for peer in peers {
processor.process(peer);
}

sleep(RECHECK_INTERVAL).await;
}
}

0 comments on commit 6194b2b

Please sign in to comment.