Skip to content

Commit

Permalink
clientv3: always return TimeToLiveResponse in TimeToLive
Browse files Browse the repository at this point in the history
  • Loading branch information
fanminshi committed Feb 10, 2017
1 parent 7041116 commit db118ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clientv3/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,18 @@ func (l *lessor) TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption
for {
r := toLeaseTimeToLiveRequest(id, opts...)
resp, err := l.remote.LeaseTimeToLive(ctx, r, grpc.FailFast(false))
gresp := &LeaseTimeToLiveResponse{ResponseHeader: resp.GetHeader()}
if err == nil {
gresp := &LeaseTimeToLiveResponse{
ResponseHeader: resp.GetHeader(),
ID: LeaseID(resp.ID),
TTL: resp.TTL,
GrantedTTL: resp.GrantedTTL,
Keys: resp.Keys,
gresp = &LeaseTimeToLiveResponse{
ID: LeaseID(resp.ID),
TTL: resp.TTL,
GrantedTTL: resp.GrantedTTL,
Keys: resp.Keys,
}
return gresp, nil
}
if isHaltErr(ctx, err) {
return nil, toErr(ctx, err)
return gresp, toErr(ctx, err)
}
}
}
Expand Down

0 comments on commit db118ff

Please sign in to comment.