forked from TrueCloudLab/restic
Merge pull request #1535 from ifedorenko/check-retry
fixed restic-check does not retry backend.Test failures
This commit is contained in:
commit
5f43e17918
1 changed files with 11 additions and 0 deletions
|
@ -117,3 +117,14 @@ func (be *RetryBackend) Remove(ctx context.Context, h restic.Handle) (err error)
|
|||
return be.Backend.Remove(ctx, h)
|
||||
})
|
||||
}
|
||||
|
||||
// Test a boolean value whether a File with the name and type exists.
|
||||
func (be *RetryBackend) Test(ctx context.Context, h restic.Handle) (exists bool, err error) {
|
||||
err = be.retry(ctx, fmt.Sprintf("Test(%v)", h), func() error {
|
||||
var innerError error
|
||||
exists, innerError = be.Backend.Test(ctx, h)
|
||||
|
||||
return innerError
|
||||
})
|
||||
return exists, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue