Merge pull request #6109 from timchenxiaoyu/githubdev
fix #6054 MaxConcurrentDownloads is not effect when Unpack is true
This commit is contained in:
commit
f44d4cf8ca
@ -65,11 +65,16 @@ func (c *Client) newUnpacker(ctx context.Context, rCtx *RemoteContext) (*unpacke
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var limiter *semaphore.Weighted
|
||||||
|
if rCtx.MaxConcurrentDownloads > 0 {
|
||||||
|
limiter = semaphore.NewWeighted(int64(rCtx.MaxConcurrentDownloads))
|
||||||
|
}
|
||||||
return &unpacker{
|
return &unpacker{
|
||||||
updateCh: make(chan ocispec.Descriptor, 128),
|
updateCh: make(chan ocispec.Descriptor, 128),
|
||||||
snapshotter: snapshotter,
|
snapshotter: snapshotter,
|
||||||
config: config,
|
config: config,
|
||||||
c: c,
|
c: c,
|
||||||
|
limiter: limiter,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user