Skip to content

Commit

Permalink
Merge pull request containerd#6109 from timchenxiaoyu/githubdev
Browse files Browse the repository at this point in the history
fix containerd#6054  MaxConcurrentDownloads is not effect when Unpack is true
  • Loading branch information
dmcgowan authored Oct 19, 2021
2 parents 9c488e5 + 535191a commit f44d4cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unpacker.go
Original file line number Diff line number Diff line change
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 f44d4cf

Please sign in to comment.