From f224d74ed7dedab69e242fa5b5703e7ec7b7bb09 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Mon, 10 Apr 2017 09:41:37 -0700 Subject: [PATCH] concurrency: use new lease interface in session --- clientv3/concurrency/session.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/clientv3/concurrency/session.go b/clientv3/concurrency/session.go index 0cb5ea7cf..2f3281d8e 100644 --- a/clientv3/concurrency/session.go +++ b/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