mirror of
https://github.com/restic/restic.git
synced 2025-12-03 23:11:47 +00:00
fix handling of maxKeys in SearchKey
This commit is contained in:
committed by
Michael Eischer
parent
1dd4b9b60e
commit
f144920ed5
@@ -137,6 +137,7 @@ func SearchKey(ctx context.Context, s *Repository, password string, maxKeys int,
|
||||
|
||||
// try at most maxKeys keys in repo
|
||||
err = s.Backend().List(listCtx, restic.KeyFile, func(fi restic.FileInfo) error {
|
||||
checked++
|
||||
if maxKeys > 0 && checked > maxKeys {
|
||||
return ErrMaxKeysReached
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user