2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

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

View File

@ -132,6 +132,10 @@ func runPrune(opts PruneOptions, gopts GlobalOptions) error {
return err 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) lock, err := lockRepoExclusive(gopts.ctx, repo)
defer unlockRepo(lock) defer unlockRepo(lock)
if err != nil { if err != nil {