Explorar o código

Merge pull request #7338 from xiang90/fix_l

clientv3: fix lease keepalive duration
Xiang Li %!s(int64=9) %!d(string=hai) anos
pai
achega
5d3597a5f2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      clientv3/lease.go

+ 1 - 1
clientv3/lease.go

@@ -407,7 +407,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) {
 	}
 
 	// send update to all channels
-	nextKeepAlive := time.Now().Add(1 + time.Duration(karesp.TTL/3)*time.Second)
+	nextKeepAlive := time.Now().Add(time.Duration(karesp.TTL/3+1) * time.Second)
 	ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second)
 	for _, ch := range ka.chs {
 		select {