From 66c88b44108c178c3fb37b5d0b4491a0f92ae253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 26 Apr 2024 17:39:14 +0000 Subject: [PATCH] cleanup --- nexus/peer-cursor/src/manager.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nexus/peer-cursor/src/manager.rs b/nexus/peer-cursor/src/manager.rs index a7ca95aebd..5384b86362 100644 --- a/nexus/peer-cursor/src/manager.rs +++ b/nexus/peer-cursor/src/manager.rs @@ -54,21 +54,18 @@ impl CursorManager { })?; let mut records = Vec::new(); - let prev_end = cursor.position; - let mut cursor_position = cursor.position; - while cursor_position - prev_end < count { + while records.len() < count { match cursor.stream.next().await { Some(Ok(record)) => { records.push(record); - cursor_position += 1; - tracing::info!("cusror position: {}", cursor_position); } Some(Err(err)) => return Err(err), None => break, } } - cursor.position = cursor_position; + tracing::info!("Cursor {} fetched {} records", name, records.len()); + cursor.position += records.len(); Ok(Records { records,