From bf146bf06941f9918e952f3b6ac8ac9ecb5ff087 Mon Sep 17 00:00:00 2001 From: Godmode Galactus Date: Tue, 5 Nov 2024 11:41:47 +0100 Subject: [PATCH] removing unnecessary baching for account updates --- bin/autobahn-router/src/edge_updater.rs | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/bin/autobahn-router/src/edge_updater.rs b/bin/autobahn-router/src/edge_updater.rs index 5d299a7..42e4898 100644 --- a/bin/autobahn-router/src/edge_updater.rs +++ b/bin/autobahn-router/src/edge_updater.rs @@ -167,20 +167,19 @@ pub fn spawn_updater_job( if !updater.invalidate_one(res) { break 'drain_loop; } - - let mut batchsize: u32 = 0; - let started_at = Instant::now(); - 'batch_loop: while let Ok(res) = account_updates.try_recv() { - batchsize += 1; - if !updater.invalidate_one(Ok(res)) { - break 'drain_loop; - } - - // budget for microbatch - if batchsize > 10 || started_at.elapsed() > Duration::from_micros(500) { - break 'batch_loop; - } - } + // let mut batchsize: u32 = 0; + // let started_at = Instant::now(); + // 'batch_loop: while let Ok(res) = account_updates.try_recv() { + // batchsize += 1; + // if !updater.invalidate_one(Ok(res)) { + // break 'drain_loop; + // } + + // // budget for microbatch + // if batchsize > 10 || started_at.elapsed() > Duration::from_micros(500) { + // break 'batch_loop; + // } + // } }, Ok(price_upd) = price_updates.recv() => { if let Some(impacted_edges) = updater.state.edges_per_mint.get(&price_upd.mint) {