very fast at protocol indexer with flexible filtering, xrpc queries, cursor-backed event stream, and more, built on fjall
rust fjall at-protocol atproto indexer
58
fork

Configure Feed

Select the types of activity you want to include in your feed.

[db] do the whole gc check in read_sync

dawn f85858a4 df5b8367

+11 -11
+11 -11
src/db/gc.rs
··· 41 41 return Ok(Verdict::Keep); 42 42 } 43 43 44 - let count = self 44 + Ok(self 45 45 .refcounts 46 - .read_sync(item.key().as_ref(), |_, v| *v) 47 - .unwrap_or(0); 48 - 49 - #[cfg(debug_assertions)] 50 - if let Ok(cid) = cid::Cid::read_bytes(item.key().as_ref()) { 51 - tracing::debug!(cid = %cid, count, "BlocksGcFilter checking block"); 52 - } 46 + .read_sync(item.key().as_ref(), |_, count| { 47 + #[cfg(debug_assertions)] 48 + if let Ok(cid) = cid::Cid::read_bytes(item.key().as_ref()) { 49 + tracing::debug!(cid = %cid, count, "BlocksGcFilter checking block"); 50 + } 53 51 54 - Ok((count <= 0) 55 - .then_some(Verdict::Destroy) 56 - .unwrap_or(Verdict::Keep)) 52 + (*count <= 0) 53 + .then_some(Verdict::Destroy) 54 + .unwrap_or(Verdict::Keep) 55 + }) 56 + .unwrap_or(Verdict::Destroy)) 57 57 } 58 58 } 59 59