Skip to content

Commit

Permalink
move depth update check to lob
Browse files Browse the repository at this point in the history
  • Loading branch information
CAGS295 committed Sep 14, 2024
1 parent 24952bf commit 1c9db36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/monitor/order_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ impl Absorb<Operations> for LimitOrderBook {
match operation {
Operations::Update(update) => {
// immediate transition with update stream.
if self.update_id + 1 < update.first_update_id
|| update.last_update_id + 1 < self.update_id
{
if update.skip_update(self.update_id) {
info!(
"Skipping stale updates stamp:{} [{},{}]",
update.event.time, update.first_update_id, update.last_update_id
Expand Down Expand Up @@ -106,7 +104,7 @@ where
tracing::Span::current().record("pair", Self::to_id(&update));
info!("[{},{}]", update.first_update_id, update.last_update_id);

DepthHandler::handle_update(self, update)
self.handle_update(update)
}

/// Although this takes a symbol slice, it only processes the first element.
Expand Down

0 comments on commit 1c9db36

Please sign in to comment.