mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #16200 from kensou97/keepalive-ctx-closer
clientv3: create keepAliveCtxCloser goroutine only if ctx can be canc…
This commit is contained in:
commit
c59bc52286
@ -294,7 +294,9 @@ func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAl
|
|||||||
}
|
}
|
||||||
l.mu.Unlock()
|
l.mu.Unlock()
|
||||||
|
|
||||||
|
if ctx.Done() != nil {
|
||||||
go l.keepAliveCtxCloser(ctx, id, ka.donec)
|
go l.keepAliveCtxCloser(ctx, id, ka.donec)
|
||||||
|
}
|
||||||
l.firstKeepAliveOnce.Do(func() {
|
l.firstKeepAliveOnce.Do(func() {
|
||||||
go l.recvKeepAliveLoop()
|
go l.recvKeepAliveLoop()
|
||||||
go l.deadlineLoop()
|
go l.deadlineLoop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user