cli: Change syncing rule for configured seeds

Instead of waiting for *all* configured/preferred seeds to be synced,
we wait for at least one.

Note that the previous behavior can still be used by setting
`--replicas` appropriately.
This commit is contained in:
cloudhead 2024-03-22 13:09:31 +01:00
parent e6728db15a
commit ff79d15bb8
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -254,9 +254,10 @@ fn announce_<R: ReadRepository>(
// We're done syncing when both of these conditions are met:
//
// 1. We've matched or exceeded our target replica count.
// 2. We've synced with the seeds specified manually.
// 2. We've synced with one of the seeds specified manually.
if replicas.len() >= settings.replicas
&& settings.seeds.iter().all(|s| replicas.contains_key(s))
&& (settings.seeds.is_empty()
|| settings.seeds.iter().any(|s| replicas.contains_key(s)))
{
ControlFlow::Break(())
} else {