prune: Fail early if too few backend connections

This commit is contained in:
Michael Eischer 2022-04-23 11:32:52 +02:00
parent e597b99b55
commit f5609d1d3c
1 changed files with 4 additions and 0 deletions

View File

@ -132,6 +132,10 @@ func runPrune(opts PruneOptions, gopts GlobalOptions) error {
return err
}
if repo.Backend().Connections() < 2 {
return errors.Fatal("prune requires a backend connection limit of at least two")
}
lock, err := lockRepoExclusive(gopts.ctx, repo)
defer unlockRepo(lock)
if err != nil {