diff options
| author | tv <tv@krebsco.de> | 2026-10-25 11:09:32 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-25 11:09:32 +0100 |
| commit | c15d738c70a9e0dbedd214c468837a3cc701768a (patch) | |
| tree | 93b397dce3d862f7ee347250ef7a627894f8f9ee /src/main.rs | |
| parent | e64a88f6da990329125e9b744c637f7d197bea3f (diff) | |
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.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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(()); |
