tangled
alpha
login
or
join now
ptr.pet
/
hydrant
25
fork
atom
at protocol indexer with flexible filtering, xrpc queries, and a cursor-backed event stream, built on fjall
at-protocol
atproto
indexer
rust
fjall
25
fork
atom
overview
issues
6
pulls
pipelines
[crawler] respect dids filters
ptr.pet
2 weeks ago
e2867db2
08a9e328
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+17
1 changed file
expand all
collapse all
unified
split
src
crawler
mod.rs
+17
src/crawler/mod.rs
···
1
1
use crate::db::{Db, keys, ser_repo_state};
2
2
+
use crate::filter::FilterMode;
2
3
use crate::state::AppState;
3
4
use crate::types::RepoState;
4
5
use jacquard::api::com_atproto::sync::list_repos::{ListRepos, ListReposOutput};
···
136
137
let mut batch = db.inner.batch();
137
138
let mut to_queue = Vec::new();
138
139
140
140
+
let filter = self.state.filter.load();
141
141
+
139
142
// 3. process repos
140
143
for repo in output.repos {
141
144
let did_key = keys::repo_key(&repo.did);
145
145
+
146
146
+
let excl_key =
147
147
+
crate::filter::filter_key(crate::filter::EXCLUDE_PREFIX, repo.did.as_str());
148
148
+
if db.filter.contains_key(&excl_key).into_diagnostic()? {
149
149
+
continue;
150
150
+
}
151
151
+
152
152
+
if filter.mode != FilterMode::Full {
153
153
+
let did_filter_key =
154
154
+
crate::filter::filter_key(crate::filter::DID_PREFIX, repo.did.as_str());
155
155
+
if !db.filter.contains_key(&did_filter_key).into_diagnostic()? {
156
156
+
continue;
157
157
+
}
158
158
+
}
142
159
143
160
// check if known
144
161
if !Db::contains_key(db.repos.clone(), &did_key).await? {