Skip to content

Commit

Permalink
Set reconnecting status when recreating session
Browse files Browse the repository at this point in the history
  • Loading branch information
bitomaxsp committed May 22, 2023
1 parent 3a675c0 commit 7cc1c9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ func (c *Client) monitor(ctx context.Context) {
// This only works if the session is still open on the server
// otherwise recreate it

c.setState(Reconnecting)

s := c.Session()
if s == nil {
dlog.Printf("no session to restore")
Expand Down Expand Up @@ -414,6 +416,7 @@ func (c *Client) monitor(ctx context.Context) {
case recreateSession:
dlog.Printf("action: recreateSession")

c.setState(Reconnecting)
// create a new session to replace the previous one

dlog.Printf("trying to recreate session")
Expand Down

0 comments on commit 7cc1c9c

Please sign in to comment.