Skip to content

Commit

Permalink
[CT-700] only send response when there is at least one update (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 committed Mar 28, 2024
1 parent 55631cb commit a87e4c1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions protocol/streaming/grpc/grpc_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ func (sm *GrpcStreamingManagerImpl) SendOrderbookUpdates(
}
}

if err := subscription.srv.Send(
&clobtypes.StreamOrderbookUpdatesResponse{
Updates: updatesToSend,
Snapshot: snapshot,
},
); err != nil {
idsToRemove = append(idsToRemove, id)
if len(updatesToSend) > 0 {
if err := subscription.srv.Send(
&clobtypes.StreamOrderbookUpdatesResponse{
Updates: updatesToSend,
Snapshot: snapshot,
},
); err != nil {
idsToRemove = append(idsToRemove, id)
}
}
}

Expand Down

0 comments on commit a87e4c1

Please sign in to comment.