Skip to content

Commit

Permalink
fix containerd#6054 MaxConcurrentDownloads is not effect when Unpack …
Browse files Browse the repository at this point in the history
…is true
  • Loading branch information
timchenxiaoyu committed Oct 9, 2021
1 parent a466309 commit b91b069
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 b91b069

Please sign in to comment.