Преглед на файлове

clientv3: KeepAliveOnce returns ErrLeaseNotFound if TTL <= 0

fanmin shi преди 8 години
родител
ревизия
8cb5e05fc9
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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 {
 		resp, err := l.keepAliveOnce(ctx, id)
 		if err == nil {
-			if resp.TTL == 0 {
+			if resp.TTL <= 0 {
 				err = rpctypes.ErrLeaseNotFound
 			}
 			return resp, err