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 | 66e5f74b54c5e300e3a8c3221bd8f1c9acee014b (patch) | |
| tree | 8647cc8afaa8ed408cb76398d71143e63b942443 /src/main.rs | |
| parent | bbd6d81fbda85e80a63c5965f42d6aedf0adfb6c (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(()); |
