Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dydxwill committed Aug 9, 2024
1 parent 102a652 commit afff020
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions protocol/streaming/full_node_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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...)
Expand Down

0 comments on commit afff020

Please sign in to comment.