summaryrefslogtreecommitdiffstats
path: root/src/remake/catchup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/catchup.rs')
-rw-r--r--src/remake/catchup.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/remake/catchup.rs b/src/remake/catchup.rs
index b00a210..0be7dfd 100644
--- a/src/remake/catchup.rs
+++ b/src/remake/catchup.rs
@@ -67,14 +67,14 @@ pub(super) async fn check<H: Host>(host: &H) {
}
if host.initial_sync_done() {
finish(host).await;
- } else if started.elapsed() > timeout {
- if let Some(rejoin) = host.remake().take_rejoin() {
- let reason = format!(
- "no peer on {target} completed a sync within {}s",
- timeout.as_secs()
- );
- abandon(host, rejoin, reason).await;
- }
+ } else if started.elapsed() > timeout
+ && let Some(rejoin) = host.remake().take_rejoin()
+ {
+ let reason = format!(
+ "no peer on {target} completed a sync within {}s",
+ timeout.as_secs()
+ );
+ abandon(host, rejoin, reason).await;
}
return;
}
@@ -253,6 +253,9 @@ enum Plan {
},
}
+// Every variant holds a whole document; one value lives for one step of a rejoin, so
+// boxing would only add an indirection.
+#[allow(clippy::large_enum_variant)]
enum Prepared {
/// Caught up with someone, but not with the target epoch yet: keep waiting.
NotYet(AutoCommit),