From 65e0069baeb42deb69dd0616e97484bc5a568d7d Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2026 11:09:32 +0100 Subject: add genesis flag and never give up The --genesis flag has been introduced to start with a new document. This prevents restarts to accidentally start with a new document and accept reads/writes, causing a second swarm to appear. Additionally, bootstrapping doesn't timeout anymore as that's of no use for nobody. --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 217a9a4..09b365b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -186,8 +186,9 @@ async fn main() -> Result<()> { tokio::spawn(remake::run_worker(state.clone())); trace!("Remake worker task spawned"); + let joining = bootstrap::bootstrap(&state, &seeds, args.genesis); tokio::select! { - joined = bootstrap::bootstrap(&state, &seeds) => joined.context("Joining swarm")?, + joined = joining => joined.context("Joining swarm")?, _ = stopped(stop.clone()) => { info!("Stopped while joining the swarm"); return Ok(()); -- cgit v1.3.1