Just make sure everything works

This commit is contained in:
Julia Lange 2025-06-05 16:09:30 -07:00
parent 079e8c5831
commit 0ce9c0e288
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
4 changed files with 32 additions and 3 deletions

View file

@ -74,7 +74,8 @@ pub mod my_spoor_session;
pub use my_spoor_session::MySpoorSession;
pub mod my_spoor_activity;
pub use my_spoor_activity::MySpoorActivity;
pub mod app_bsky_post;
pub use app_bsky_post::AppBskyPost;
struct CommitIngestorState;

View file

@ -0,0 +1,26 @@
use crate::collections::CommitIngestorState;
use rocketman::types::event::Event;
use serde_json::Value;
use anyhow::Result;
use tracing::info;
async fn handle_change(
_state: CommitIngestorState,
message: Event<Value>
) -> Result<()> {
info!("{:?}", message);
Ok(())
}
async fn handle_delete(
_state: CommitIngestorState,
message: Event<Value>
) -> Result<()> {
info!("{:?}", message);
Ok(())
}
create_commit_collection!(AppBskyPost, "app.bsky.feed.post".to_string(),
change => handle_change,
delete => handle_delete,
);

View file

@ -25,7 +25,8 @@ impl Ingestor {
}
pub async fn start(self) {
info!("Starting ingestor");
info!("Starting ingestor with the following collections: {:?}",
self.ingesters.keys());
let opts = JetstreamOptions::builder()
.wanted_collections(self.ingesters.keys().cloned().collect())
.build();

View file

@ -1,7 +1,7 @@
use crate::{
collections::{
Collection,
MySpoorActivity, MySpoorSession,
MySpoorActivity, MySpoorSession, AppBskyPost,
},
ingestor::Ingestor,
};
@ -17,5 +17,6 @@ async fn main() {
let mut ingestor = Ingestor::new();
ingestor.add_collection(MySpoorActivity::new());
ingestor.add_collection(MySpoorSession::new());
ingestor.add_collection(AppBskyPost::new());
ingestor.start().await;
}