Skip to content

Commit

Permalink
fix #6054 MaxConcurrentDownloads is not effect when Unpack is true
Browse files Browse the repository at this point in the history
Signed-off-by: weixian.cxy <weixian.cxy@alibaba-inc.com>
(cherry picked from commit 535191a)
  • Loading branch information
timchenxiaoyu authored and mikebrow committed Apr 4, 2022
1 parent 0849845 commit 4dbd0c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unpacker.go
Expand Up @@ -65,11 +65,16 @@ func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacke
return nil, err
}
}
var limiter *semaphore.Weighted
if rCtx.MaxConcurrentDownloads > 0 {
limiter = semaphore.NewWeighted(int64(rCtx.MaxConcurrentDownloads))
}
return &unpacker{
updateCh: make(chan ocispec.Descriptor, 128),
snapshotter: snapshotter,
config: config,
c: c,
limiter: limiter,
}, nil
}

Expand Down

0 comments on commit 4dbd0c8

Please sign in to comment.