Skip to content

Commit

Permalink
Merge pull request #599 from hotafrika/fix/infinite-reconnect-in-monitor
Browse files Browse the repository at this point in the history
skip StatusBadNoSubscription in monitor loop
  • Loading branch information
magiconair authored Mar 22, 2023
2 parents bc0a18e + f041aad commit 77520dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ func (c *Client) monitor(ctx context.Context) {
return
}

// the subscriptions don't exist for session.
// skip this error and continue monitor loop
if errors.Is(err, ua.StatusBadNoSubscription) {
continue
}

// tell the handler the connection is disconnected
c.setState(Disconnected)
dlog.Print("disconnected")
Expand Down

0 comments on commit 77520dc

Please sign in to comment.