Skip to content

Commit

Permalink
fix: remove sub changes request when timeout happens
Browse files Browse the repository at this point in the history
  • Loading branch information
hiohiohio committed Mar 26, 2024
1 parent a9f58a9 commit 63e91f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions marketdata/stream/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ func (c *client) handleSubChange(subscribe bool, changes subscriptions) error {
c.pendingSubChange = nil
// Drain the c.subChanges channel to avoid waiting size 1 channel when connection is lost.
// Please consider using connect/disconnect callbacks to avoid requesting sub change during disconnection.
// select {
// case <-c.subChanges:
// c.logger.Warnf("datav2stream: removed sub changes request due to timeout")
// default:
// }
select {
case <-c.subChanges:
c.logger.Warnf("datav2stream: removed sub changes request due to timeout")
default:
}
}

return ErrSubscriptionChangeTimeout
Expand Down

0 comments on commit 63e91f8

Please sign in to comment.