mirror of
https://github.com/restic/restic.git
synced 2024-12-23 00:07:25 +00:00
restore: avoid long cancelation delay for frequently used blobs
This commit is contained in:
parent
f64191da9c
commit
c77b2d5ca2
1 changed files with 5 additions and 0 deletions
|
@ -327,6 +327,11 @@ func (r *fileRestorer) downloadBlobs(ctx context.Context, packID restic.ID,
|
|||
}
|
||||
for file, offsets := range blob.files {
|
||||
for _, offset := range offsets {
|
||||
// avoid long cancelation delays for frequently used blobs
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
writeToFile := func() error {
|
||||
// this looks overly complicated and needs explanation
|
||||
// two competing requirements:
|
||||
|
|
Loading…
Reference in a new issue