···1+pub mod api;
2+pub mod backfill;
3+pub mod config;
4+pub mod crawler;
5+pub mod db;
6+pub mod ingest;
7+pub mod ops;
8+pub mod resolver;
9+pub mod state;
10+pub mod types;
+9-20
src/main.rs
···1-mod api;
2-mod backfill;
3-mod config;
4-mod crawler;
5-mod db;
6-mod ingest;
7-mod ops;
8-mod resolver;
9-mod state;
10-mod types;
11-12-use crate::config::{Config, SignatureVerification};
13-use crate::crawler::Crawler;
14-use crate::db::set_firehose_cursor;
15-use crate::ingest::firehose::FirehoseIngestor;
16-use crate::state::AppState;
17-use crate::{backfill::BackfillWorker, ingest::worker::FirehoseWorker};
18use futures::{FutureExt, TryFutureExt, future::BoxFuture};
19use miette::IntoDiagnostic;
20use mimalloc::MiMalloc;
···8182 if let Err(e) = spawn_blocking({
83 let state = state.clone();
84- move || crate::backfill::manager::queue_pending_backfills(&state)
85 })
86 .await
87 .into_diagnostic()?
···9293 if let Err(e) = spawn_blocking({
94 let state = state.clone();
95- move || crate::backfill::manager::queue_gone_backfills(&state)
96 })
97 .await
98 .into_diagnostic()?
···103104 std::thread::spawn({
105 let state = state.clone();
106- move || crate::backfill::manager::retry_worker(state)
107 });
108109 tokio::spawn({
···1+use hydrant::config::{Config, SignatureVerification};
2+use hydrant::crawler::Crawler;
3+use hydrant::db::{self, set_firehose_cursor};
4+use hydrant::ingest::firehose::FirehoseIngestor;
5+use hydrant::state::AppState;
6+use hydrant::{api, backfill::BackfillWorker, ingest::worker::FirehoseWorker};
000000000007use futures::{FutureExt, TryFutureExt, future::BoxFuture};
8use miette::IntoDiagnostic;
9use mimalloc::MiMalloc;
···7071 if let Err(e) = spawn_blocking({
72 let state = state.clone();
73+ move || hydrant::backfill::manager::queue_pending_backfills(&state)
74 })
75 .await
76 .into_diagnostic()?
···8182 if let Err(e) = spawn_blocking({
83 let state = state.clone();
84+ move || hydrant::backfill::manager::queue_gone_backfills(&state)
85 })
86 .await
87 .into_diagnostic()?
···9293 std::thread::spawn({
94 let state = state.clone();
95+ move || hydrant::backfill::manager::retry_worker(state)
96 });
9798 tokio::spawn({
+8-7
src/ops.rs
···190191 trace!("parsed car for {did} in {:?}", start.elapsed());
1920000000193 if let Some(key) = signing_key {
194- let root_bytes = parsed
195- .blocks
196- .get(&parsed.root)
197- .ok_or_else(|| miette::miette!("root block missing from CAR"))?;
198-199- let repo_commit = jacquard_repo::commit::Commit::from_cbor(root_bytes).into_diagnostic()?;
200 repo_commit
201 .verify(key)
202 .map_err(|e| miette::miette!("signature verification failed for {did}: {e}"))?;
···204 }
205206 repo_state.rev = Some(commit.rev.clone());
207- repo_state.data = Some(Cid::ipld(parsed.root));
208 repo_state.last_updated_at = chrono::Utc::now().timestamp();
209210 batch.insert(&db.repos, keys::repo_key(did), ser_repo_state(&repo_state)?);
···190191 trace!("parsed car for {did} in {:?}", start.elapsed());
192193+ let root_bytes = parsed
194+ .blocks
195+ .get(&parsed.root)
196+ .ok_or_else(|| miette::miette!("root block missing from CAR"))?;
197+198+ let repo_commit = jacquard_repo::commit::Commit::from_cbor(root_bytes).into_diagnostic()?;
199+200 if let Some(key) = signing_key {
000000201 repo_commit
202 .verify(key)
203 .map_err(|e| miette::miette!("signature verification failed for {did}: {e}"))?;
···205 }
206207 repo_state.rev = Some(commit.rev.clone());
208+ repo_state.data = Some(Cid::ipld(repo_commit.data));
209 repo_state.last_updated_at = chrono::Utc::now().timestamp();
210211 batch.insert(&db.repos, keys::repo_key(did), ser_repo_state(&repo_state)?);