Merge pull request #4403 from cli/cs-concurrent-requests
Don't allow the lazyLoadedHTTPClient mutex to wrap `Do()`
This commit is contained in:
commit
cb6db95ec6
1 changed files with 3 additions and 3 deletions
|
|
@ -151,14 +151,14 @@ func (l *lazyLoadedHTTPClient) Do(req *http.Request) (*http.Response, error) {
|
|||
l.httpClientMu.RUnlock()
|
||||
|
||||
if httpClient == nil {
|
||||
l.httpClientMu.Lock()
|
||||
defer l.httpClientMu.Unlock()
|
||||
|
||||
var err error
|
||||
l.httpClientMu.Lock()
|
||||
l.httpClient, err = l.factory.HttpClient()
|
||||
l.httpClientMu.Unlock()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return l.httpClient.Do(req)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue