Skip to content

Commit 64dec1c

Browse files
committed
fix: broken cursor
1 parent 8003d4b commit 64dec1c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/sources/common.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,18 @@ macro_rules! intersect_starting_point {
272272
Some(cursor) => {
273273
log::info!("found persisted cursor, will use as starting point");
274274
let desired = cursor.try_into()?;
275-
let (point, _) = client.find_intersect(vec![desired])?;
276-
277-
Ok(point)
275+
let res = client.find_intersect(vec![desired]);
276+
match res {
277+
Ok((point, _)) => Ok(point),
278+
Err(e) => {
279+
log::error!(
280+
"error finding intersect point from cursor - starting from tip: {:?}",
281+
e
282+
);
283+
let point = client.intersect_tip()?;
284+
return Ok(Some(point));
285+
}
286+
}
278287
}
279288
None => match intersect_arg {
280289
Some(IntersectArg::Fallbacks(x)) => {
@@ -305,7 +314,6 @@ macro_rules! intersect_starting_point {
305314
}
306315
Some(IntersectArg::Tip) => {
307316
log::info!("found 'tip' intersect argument, will use as starting point");
308-
309317
let point = client.intersect_tip()?;
310318

311319
Ok(Some(point))

0 commit comments

Comments
 (0)