Pārlūkot izejas kodu

clientv3: KeepAliveOnce returns ErrLeaseNotFound if TTL <= 0

fanmin shi 8 gadi atpakaļ
vecāks
revīzija
8cb5e05fc9
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      clientv3/lease.go

+ 1 - 1
clientv3/lease.go

@@ -255,7 +255,7 @@ func (l *lessor) KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAlive
 	for {
 	for {
 		resp, err := l.keepAliveOnce(ctx, id)
 		resp, err := l.keepAliveOnce(ctx, id)
 		if err == nil {
 		if err == nil {
-			if resp.TTL == 0 {
+			if resp.TTL <= 0 {
 				err = rpctypes.ErrLeaseNotFound
 				err = rpctypes.ErrLeaseNotFound
 			}
 			}
 			return resp, err
 			return resp, err