Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: adding env var for gossip tick
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
  • Loading branch information
Freyskeyd committed Jun 27, 2023
1 parent be8c23d commit 430038e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/topos-p2p/src/behaviour/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ impl Behaviour {
gossipsub,
echo_queue: VecDeque::new(),
ready_queue: VecDeque::new(),
tick: tokio::time::interval(Duration::from_millis(100)),
tick: tokio::time::interval(Duration::from_millis(
env::var("TOPOS_GOSSIP_INTERVAL")
.map(|v| v.parse::<u64>())
.unwrap_or(Ok(100))
.unwrap(),
)),
}
}
}
Expand Down Expand Up @@ -139,6 +144,8 @@ impl NetworkBehaviour for Behaviour {
for _ in 0..self.batch_size {
if let Some(data) = self.echo_queue.pop_front() {
echos.data.push(data);
} else {
break;
}
}

Expand All @@ -152,6 +159,8 @@ impl NetworkBehaviour for Behaviour {
for _ in 0..self.batch_size {
if let Some(data) = self.ready_queue.pop_front() {
readies.data.push(data);
} else {
break;
}
}

Expand Down

0 comments on commit 430038e

Please sign in to comment.