Skip to content

Commit

Permalink
fix: broken cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
joacohoyos committed Nov 26, 2024
1 parent 8003d4b commit 64dec1c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/sources/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,18 @@ macro_rules! intersect_starting_point {
Some(cursor) => {
log::info!("found persisted cursor, will use as starting point");
let desired = cursor.try_into()?;
let (point, _) = client.find_intersect(vec![desired])?;

Ok(point)
let res = client.find_intersect(vec![desired]);
match res {
Ok((point, _)) => Ok(point),
Err(e) => {
log::error!(
"error finding intersect point from cursor - starting from tip: {:?}",
e
);
let point = client.intersect_tip()?;
return Ok(Some(point));
}
}
}
None => match intersect_arg {
Some(IntersectArg::Fallbacks(x)) => {
Expand Down Expand Up @@ -305,7 +314,6 @@ macro_rules! intersect_starting_point {
}
Some(IntersectArg::Tip) => {
log::info!("found 'tip' intersect argument, will use as starting point");

let point = client.intersect_tip()?;

Ok(Some(point))
Expand Down

0 comments on commit 64dec1c

Please sign in to comment.