Skip to content

Commit

Permalink
Fixed goroutine exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Xemdo committed Apr 21, 2023
1 parent 96a6b3f commit e748f82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/events/websocket/mock_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (ws *WebSocketServer) WsPageHandler(w http.ResponseWriter, r *http.Request)
case <-client.keepAliveLoopChan:
client.keepAliveTimer.Stop()
client.keepAliveLoopChan = nil
break
return

case <-client.keepAliveTimer.C: // Send KeepAlive message
keepAliveMsg, _ := json.Marshal(
Expand Down Expand Up @@ -207,7 +207,7 @@ func (ws *WebSocketServer) WsPageHandler(w http.ResponseWriter, r *http.Request)
case <-client.pingLoopChan:
client.pingTimer.Stop()
client.pingLoopChan = nil
break
return

case <-client.pingTimer.C: // Send ping
err := client.SendMessage(websocket.PingMessage, []byte{})
Expand Down

0 comments on commit e748f82

Please sign in to comment.