From ad3fe59713a0518c3e86e9bbf6a541ecd9f8ecfa Mon Sep 17 00:00:00 2001 From: phil Date: Wed, 6 May 2026 17:03:33 -0400 Subject: [PATCH] add a `--print-cursor` debug flag --- constellation/src/bin/main.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/constellation/src/bin/main.rs b/constellation/src/bin/main.rs index d79f463..a7a7fb6 100644 --- a/constellation/src/bin/main.rs +++ b/constellation/src/bin/main.rs @@ -67,6 +67,9 @@ struct Args { /// fix the constellation start date (funny previous bug oops) #[arg(long, action)] reset_db_start: bool, + /// debugging: print the current jetstream cursor and exit + #[arg(long, action)] + print_cursor: bool, } #[derive(Debug, Clone, ValueEnum)] @@ -89,6 +92,18 @@ fn jetstream_url(provided: &str) -> String { fn main() -> Result<()> { let args = Args::parse(); + #[cfg(feature = "rocks")] + if args.print_cursor { + let storage_dir = args.data.clone().unwrap_or("rocks.test".into()); + let mut store = RocksStorage::open_readonly(storage_dir)?; + if let Some(cursor) = store.get_cursor()? { + println!("cursor: {cursor}"); + } else { + println!("[no cursor]"); + } + return Ok(()); + } + println!("starting with storage backend: {:?}...", args.backend); let fixture = args.fixture; -- 2.51.2