Browse Source

concurrency: use new lease interface in session

Anthony Romano 8 years ago
parent
commit
f224d74ed7
1 changed files with 2 additions and 5 deletions
  1. 2 5
      clientv3/concurrency/session.go

+ 2 - 5
clientv3/concurrency/session.go

@@ -51,12 +51,9 @@ func NewSession(client *v3.Client, opts ...SessionOption) (*Session, error) {
 	}
 
 	ctx, cancel := context.WithCancel(ops.ctx)
-	keepAlive, err := client.KeepAlive(ctx, id)
-	if err != nil || keepAlive == nil {
-		return nil, err
-	}
-
+	keepAlive := client.KeepAlive(ctx, id)
 	donec := make(chan struct{})
+
 	s := &Session{client: client, opts: ops, id: id, cancel: cancel, donec: donec}
 
 	// keep the lease alive until client error or cancelled context