···7979 self.subscriber_options.cursor = cursor;8080 self8181 }8282+8383+ /// Add the specified collection filters to the config.8484+ ///8585+ /// # Panics8686+ ///8787+ /// Panics if a collection is not a valid NSID or if the maximum number of filters is8888+ /// exceeded.8989+ ///9090+ pub fn with_collections<'a>(mut self, collections: impl IntoIterator<Item = &'a str>) -> Self {9191+ for collection in collections {9292+ let collection = collection9393+ .parse()9494+ .expect("collection filter should be valid");9595+ self.subscriber_options9696+ .add_collection(collection)9797+ .expect("collection filters count should not exceed maximum");9898+ }9999+ self100100+ }82101}8310284103#[cfg(test)]
+3-1
crates/knot/src/main.rs
···211211 tracing::info!(?cursor, ?cursor_us, "found jetstream cursor");212212 }213213214214- let mut config = JetstreamConfig::default().with_cursor(cursor.map(|(_, us)| us));214214+ let mut config = JetstreamConfig::default()215215+ .with_cursor(cursor.map(|(_, us)| us))216216+ .with_collections(["sh.tangled.publicKey", "sh.tangled.repo"]);215217216218 let mut records = sqlx::query!(217219 "SELECT DISTINCT did FROM knot_member UNION SELECT DISTINCT did FROM repository_member"