From ea50d0281e217b421c2ab8bcaae9a82984750dc0 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Tue, 11 Jun 2024 00:34:39 +0200 Subject: fs-tracer: cleanup --- fs-tracer/src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs-tracer/src/main.rs b/fs-tracer/src/main.rs index bc3eae9..bb4b6db 100644 --- a/fs-tracer/src/main.rs +++ b/fs-tracer/src/main.rs @@ -109,15 +109,13 @@ async fn main() -> Result<(), anyhow::Error> { info!("Waiting for threads to stop"); let mut batched_req = vec![]; - let mut i = 0; for elt in resolved_files_recv { batched_req.push(elt); - i += 1; // Batching. TODO: we can probably increase this value but we need to increase max message // in kafka or compress or smth. We should probably batch taking into account the message // size and also sent messages from multiple threads somehow. // We might just need websockets - if i % 4000 != 0 { + if batched_req.len() < 4000 { continue; } let request_body = format!("[{}]", batched_req.join(",")); -- cgit 1.4.1