Skip to content

Commit

Permalink
try to fix reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Redrield committed Aug 29, 2023
1 parent 3211783 commit 001cdd0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions backend/api/services/websocket/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ func HandleWebSocket(s *state.State, w http.ResponseWriter, r *http.Request) {
}

var frame Frame
ctx, cancel = context.WithTimeout(context.Background(), time.Second*5)
err := wsjson.Read(ctx, conn, &frame)
cancel()
err := wsjson.Read(context.Background(), conn, &frame)
if err != nil {
log.Println("Error reading WebSocket message: ", err)
//conn.Close(websocket.StatusInvalidFramePayloadData, "Could not read websocket message")
Expand Down Expand Up @@ -329,7 +327,6 @@ func writePump(conn *websocket.Conn, msgQueue chan Message) error {
if err != nil {
return err
}
break;

case message, ok := <-msgQueue:
if !ok {
Expand Down

0 comments on commit 001cdd0

Please sign in to comment.