Skip to content

Commit

Permalink
setSession if activate failes to close it properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddin-619 committed Jun 1, 2023
1 parent 9697a6e commit 7edbd31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func (c *Client) Connect(ctx context.Context) error {
}

if err := c.ActivateSessionWithContext(ctx, s); err != nil {
c.setSession(s)
c.CloseWithContext(ctx)
stats.RecordError(err)

Expand Down

0 comments on commit 7edbd31

Please sign in to comment.