mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
leasehttp: buffer error channel to prevent goroutine leak
This commit is contained in:
parent
fef4a79528
commit
7b7feb46fc
@ -206,7 +206,8 @@ func TimeToLiveHTTP(ctx context.Context, id lease.LeaseID, keys bool, url string
|
||||
|
||||
cc := &http.Client{Transport: rt}
|
||||
var b []byte
|
||||
errc := make(chan error)
|
||||
// buffer errc channel so that errc don't block inside the go routinue
|
||||
errc := make(chan error, 2)
|
||||
go func() {
|
||||
resp, err := cc.Do(req)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user