Merge pull request #4605 from MichaelEischer/better-restorer-error-handling

Rework repository.StreamPacks & better restorer error handling
This commit is contained in:
Michael Eischer
2024-05-01 16:37:41 +02:00
committed by GitHub
5 changed files with 248 additions and 82 deletions

View File

@@ -79,13 +79,8 @@ func repack(ctx context.Context, repo restic.Repository, dstRepo restic.Reposito
for t := range downloadQueue {
err := repo.LoadBlobsFromPack(wgCtx, t.PackID, t.Blobs, func(blob restic.BlobHandle, buf []byte, err error) error {
if err != nil {
var ierr error
// check whether we can get a valid copy somewhere else
buf, ierr = repo.LoadBlob(wgCtx, blob.Type, blob.ID, nil)
if ierr != nil {
// no luck, return the original error
return err
}
// a required blob couldn't be retrieved
return err
}
keepMutex.Lock()