Skip to content

Commit 535191a

Browse files
committed
fix containerd#6054 MaxConcurrentDownloads is not effect when Unpack is true
Signed-off-by: weixian.cxy <[email protected]>
1 parent a466309 commit 535191a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

unpacker.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,16 @@ func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacke
6565
return nil, err
6666
}
6767
}
68+
var limiter *semaphore.Weighted
69+
if rCtx.MaxConcurrentDownloads > 0 {
70+
limiter = semaphore.NewWeighted(int64(rCtx.MaxConcurrentDownloads))
71+
}
6872
return &unpacker{
6973
updateCh: make(chan ocispec.Descriptor, 128),
7074
snapshotter: snapshotter,
7175
config: config,
7276
c: c,
77+
limiter: limiter,
7378
}, nil
7479
}
7580

0 commit comments

Comments
 (0)