diff options
Diffstat (limited to 'src/swarm/stability.rs')
| -rw-r--r-- | src/swarm/stability.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/swarm/stability.rs b/src/swarm/stability.rs index c163778..07ee1b3 100644 --- a/src/swarm/stability.rs +++ b/src/swarm/stability.rs @@ -39,7 +39,7 @@ const BRIEF_ABSENCE: Duration = Duration::from_secs(3600); /// How long after becoming ready we wait for a peer to tell us how long we were away. const AWAY_REPORT_GRACE: Duration = Duration::from_secs(30); /// A gap between two measurements longer than this means we didn't run (asleep). -const MAX_TICK_GAP: Duration = Duration::from_secs(30); +const MAX_TICK_GAP: Duration = Duration::from_secs(120); #[derive(Debug, Default)] pub(crate) struct Stability { @@ -157,6 +157,11 @@ pub(crate) fn away(state: &AppState, gap: Duration) { } } +/// Whether the tier this node found after a restart is decided (`tick`). +pub(crate) fn settled(state: &AppState) -> bool { + lock(state).settled +} + /// Measures, and updates our tier in the registry when it should change. Called every /// few seconds by the peer worker. pub(crate) async fn tick(state: &AppState) { |
