Skip to content

Commit

Permalink
client: used WithTimeout instead of WithDuration
Browse files Browse the repository at this point in the history
Signed-off-by: AngstyDuck <[email protected]>
  • Loading branch information
AngstyDuck committed Sep 3, 2023
1 parent b825b6d commit 600ffc3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/v3/concurrency/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func NewSession(client *v3.Client, opts ...SessionOption) (*Session, error) {
var cancel context.CancelFunc
sessionCreationCtx := ops.ctx
if ops.creationTimeout > 0 {
clientDeadline := time.Now().Add(ops.creationTimeout)
sessionCreationCtx, cancel = context.WithDeadline(ops.ctx, clientDeadline)
sessionCreationCtx, cancel = context.WithTimeout(ops.ctx, ops.creationTimeout)
}

id := ops.leaseID
Expand Down

0 comments on commit 600ffc3

Please sign in to comment.