Skip to content

Commit

Permalink
Fix ws writer so it doesn't send stream to scala
Browse files Browse the repository at this point in the history
  • Loading branch information
sgueissa committed Jun 30, 2024
1 parent 4b7ef79 commit 1593100
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions be1-go/internal/network/socket/socket_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,13 @@ func (s *baseSocket) WritePump() {
return
}

w, err := s.conn.NextWriter(websocket.TextMessage)
err := s.conn.WriteMessage(websocket.TextMessage, message)
if err != nil {
s.log.Err(err).Msg("failed to retrieve writer")
s.log.Error().Err(err).Send()
return
}

w.Write(message)
s.log.Info().RawJSON("sent", message).Msg("")

if err := w.Close(); err != nil {
s.log.Err(err).Msg("failed to close writer")
return
}
case <-ticker.C:
s.conn.SetWriteDeadline(time.Now().Add(writeWait))
if err := s.conn.WriteMessage(websocket.PingMessage, nil); err != nil {
Expand Down

0 comments on commit 1593100

Please sign in to comment.