From afff0202b9414d557cb78ad84eec1fc8a93acfb9 Mon Sep 17 00:00:00 2001 From: Will Liu Date: Fri, 9 Aug 2024 11:34:53 -0400 Subject: [PATCH] fix --- protocol/streaming/full_node_streaming_manager.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/protocol/streaming/full_node_streaming_manager.go b/protocol/streaming/full_node_streaming_manager.go index 9ef7e3d91b..163f5e8fae 100644 --- a/protocol/streaming/full_node_streaming_manager.go +++ b/protocol/streaming/full_node_streaming_manager.go @@ -449,7 +449,7 @@ func (sm *FullNodeStreamingManagerImpl) SendOrderbookUpdates( clobPairIds = append(clobPairIds, clobPairId) } - sm.AddOrderbookUpdatesToCache(streamUpdates, clobPairIds, uint32(len(updates))) + sm.AddOrderbookUpdatesToCache(streamUpdates, clobPairIds) } // SendOrderbookFillUpdates groups fills by their clob pair ids and @@ -492,7 +492,7 @@ func (sm *FullNodeStreamingManagerImpl) SendOrderbookFillUpdates( clobPairIds = append(clobPairIds, clobPairId) } - sm.AddOrderbookUpdatesToCache(streamUpdates, clobPairIds, uint32(len(orderbookFills))) + sm.AddOrderbookUpdatesToCache(streamUpdates, clobPairIds) } // SendSubaccountUpdates groups subaccount updates by their subaccount ids and @@ -549,21 +549,19 @@ func (sm *FullNodeStreamingManagerImpl) SendTakerOrderStatus( }, }, []uint32{clobPairId}, - 1, ) } func (sm *FullNodeStreamingManagerImpl) AddOrderbookUpdatesToCache( updates []clobtypes.StreamUpdate, clobPairIds []uint32, - numUpdatesToAdd uint32, ) { sm.Lock() defer sm.Unlock() metrics.IncrCounter( metrics.GrpcAddUpdateToBufferCount, - float32(numUpdatesToAdd), + float32(len(updates)), ) sm.streamUpdateCache = append(sm.streamUpdateCache, updates...)