Skip to content

Commit

Permalink
Merge pull request #700 from mvandergrift/libremfg-clear-local-sessio…
Browse files Browse the repository at this point in the history
…n-on-recreate

setSession to nil in recreateSession action to avoid unnecessary CloseSession
  • Loading branch information
magiconair committed Dec 7, 2023
2 parents 1782ad0 + bc2e844 commit 7cf7173
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ func (c *Client) monitor(ctx context.Context) {
c.setState(Reconnecting)
// create a new session to replace the previous one

// clear any previous session as we know the server has closed it
// this also prevents any unnecessary calls to CloseSession
c.setSession(nil)

dlog.Printf("trying to recreate session")
s, err := c.CreateSession(ctx, c.cfg.session)
if err != nil {
Expand Down

0 comments on commit 7cf7173

Please sign in to comment.