Revert "Merge pull request #7732 from heyitsanthony/lease-err-ka"
This reverts commitfbbc4a4979
, reversing changes made tof254e38385
. Fixes #7851
This commit is contained in:
@ -56,6 +56,7 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) {
|
||||
for {
|
||||
var (
|
||||
l *clientv3.LeaseGrantResponse
|
||||
lk *clientv3.LeaseKeepAliveResponse
|
||||
err error
|
||||
)
|
||||
for {
|
||||
@ -67,14 +68,13 @@ func runLeaseRenewerFunc(cmd *cobra.Command, args []string) {
|
||||
expire := time.Now().Add(time.Duration(l.TTL-1) * time.Second)
|
||||
|
||||
for {
|
||||
lk := c.Lease.KeepAliveOnce(ctx, l.ID)
|
||||
err = lk.Err
|
||||
lk, err = c.Lease.KeepAliveOnce(ctx, l.ID)
|
||||
if grpc.Code(err) == codes.NotFound {
|
||||
if time.Since(expire) < 0 {
|
||||
log.Fatalf("bad renew! exceeded: %v", time.Since(expire))
|
||||
for {
|
||||
lk = c.Lease.KeepAliveOnce(ctx, l.ID)
|
||||
fmt.Println(lk)
|
||||
lk, err = c.Lease.KeepAliveOnce(ctx, l.ID)
|
||||
fmt.Println(lk, err)
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user