2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-25 20:11:06 +00:00

fixed restic-check does not retry backend.Test failures

added missing RetryBackend.Test implementation

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
This commit is contained in:
Igor Fedorenko 2018-01-06 23:13:42 -05:00
parent 180741609e
commit 8c550ca011

View File

@ -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
}