mirror of
https://github.com/octoleo/restic.git
synced 2024-11-21 20:35:12 +00:00
Merge pull request #1535 from ifedorenko/check-retry
fixed restic-check does not retry backend.Test failures
This commit is contained in:
commit
5f43e17918
@ -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 New Issue
Block a user