Skip to content

Commit

Permalink
fix: fix err
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 23, 2024
1 parent d440580 commit 76378fd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions node/pkg/dal/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,17 @@ func (c *Controller) broadcastDataForSymbol(symbol string) {

// pass by pointer to reduce memory copy time
func (c *Controller) castSubmissionData(data *dalcommon.OutgoingSubmissionData, symbol *string) {
c.mu.RLock()
c.mu.Lock()
defer c.mu.Unlock()
for conn := range c.clients {
if _, ok := c.clients[conn][*symbol]; ok {
if err := conn.WriteJSON(*data); err != nil {
log.Error().Err(err).Msg("failed to write message")
c.mu.RUnlock()
c.mu.Lock()
delete(c.clients, conn)
conn.Close()
c.mu.Unlock()
c.mu.RLock()
}
}
}
c.mu.RUnlock()
}

func HandleWebsocket(conn *websocket.Conn) {
Expand Down

0 comments on commit 76378fd

Please sign in to comment.