Add more checks for canceled contexts

This commit is contained in:
Michael Eischer
2024-07-31 19:30:47 +02:00
parent 8d5e188218
commit ae1cb889dd
17 changed files with 87 additions and 3 deletions

View File

@@ -95,6 +95,10 @@ func checkPackInner(ctx context.Context, r *Repository, id restic.ID, blobs []re
it := newPackBlobIterator(id, newBufReader(bufRd), 0, blobs, r.Key(), dec)
for {
if ctx.Err() != nil {
return ctx.Err()
}
val, err := it.Next()
if err == errPackEOF {
break

View File

@@ -1000,6 +1000,10 @@ func streamPackPart(ctx context.Context, beLoad backendLoadFn, loadBlobFn loadBl
it := newPackBlobIterator(packID, newByteReader(data), dataStart, blobs, key, dec)
for {
if ctx.Err() != nil {
return ctx.Err()
}
val, err := it.Next()
if err == errPackEOF {
break