at protocol indexer with flexible filtering, xrpc queries, and a cursor-backed event stream, built on fjall
at-protocol atproto indexer rust fjall

[crawler] make sure we insert the retry state if at max attempt

ptr.pet e7bd21eb 2feb1078

verified
+12 -11
+12 -11
src/crawler/mod.rs
··· 785 785 attempts: prev_attempts, 786 786 ..state 787 787 }; 788 - if let Some(next) = carried.next_attempt() { 789 - batch.insert( 790 - &db.crawler, 791 - keys::crawler_retry_key(&did), 792 - rmp_serde::to_vec(&next) 793 - .into_diagnostic() 794 - .wrap_err("cant ser retry state")?, 795 - ); 796 - } 797 - // next_attempt() == None means we've hit the cap; 798 - // leave the existing entry untouched for API inspection 788 + let next = match carried.next_attempt() { 789 + Some(next) => next, 790 + None => RetryState { 791 + attempts: MAX_RETRY_ATTEMPTS, 792 + ..state 793 + }, 794 + }; 795 + batch.insert( 796 + &db.crawler, 797 + keys::crawler_retry_key(&did), 798 + rmp_serde::to_vec(&next).into_diagnostic()?, 799 + ); 799 800 } 800 801 } 801 802 }