Skip to content

Commit

Permalink
Run db operations in goroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
pouya-eghbali committed Mar 24, 2024
1 parent 0e5ef1f commit f158e27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func processPriceReport(conn *websocket.Conn, messageType int, payload []byte) e
Error("Cannot marshal the broadcast packet")
} else {
// TODO: Safe to use 'go' here?
consumer.Broadcast(
go consumer.Broadcast(
append(
[]byte{opcodes.PriceReportBroadcast},
broadcastPayload...,
Expand Down Expand Up @@ -362,7 +362,7 @@ func processEventLog(conn *websocket.Conn, messageType int, payload []byte) erro
Error("Cannot marshal the broadcast packet")
} else {
// TODO: Safe to use 'go' here?
consumer.Broadcast(
go consumer.Broadcast(
append(
[]byte{opcodes.EventLogBroadcast},
broadcastPayload...,
Expand Down Expand Up @@ -445,7 +445,7 @@ func processCorrectnessRecord(conn *websocket.Conn, messageType int, payload []b
Error("Cannot marshal the broadcast packet")
} else {
// TODO: Safe to use 'go' here?
consumer.Broadcast(
go consumer.Broadcast(
append(
[]byte{opcodes.CorrectnessReportBroadcast},
broadcastPayload...,
Expand Down

0 comments on commit f158e27

Please sign in to comment.