Skip to content

Commit

Permalink
Fix unintentional disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Sep 13, 2024
1 parent 2a4f2b5 commit a53c457
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion websocket_managed_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ func (rtm *RTM) handleEvents(events chan json.RawMessage) {
func (rtm *RTM) handleIncomingEvents(events chan json.RawMessage) {
for {
if err := rtm.receiveIncomingEvent(events); err != nil {
_ = rtm.Disconnect()
select {
case rtm.killChannel <- false:
case <-rtm.disconnected:
default:
}
return
}
}
Expand Down

0 comments on commit a53c457

Please sign in to comment.