tangled
alpha
login
or
join now
ptr.pet
/
nsid-tracker
3
fork
atom
tracks lexicons and how many times they appeared on the jetstream
3
fork
atom
overview
issues
pulls
pipelines
feat(server): add cmd to print all hits
ptr.pet
7 months ago
ff50dac5
f4563532
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+19
1 changed file
expand all
collapse all
unified
split
server
src
main.rs
+19
server/src/main.rs
···
53
53
debug();
54
54
return;
55
55
}
56
56
+
Some("print") => {
57
57
+
print_all();
58
58
+
return;
59
59
+
}
56
60
Some(x) => {
57
61
tracing::error!("unknown command: {}", x);
58
62
return;
···
205
209
ingest_events.join().expect("failed to join ingest events");
206
210
db_task.await.expect("cant join db task");
207
211
db.sync(true).expect("cant sync db");
212
212
+
}
213
213
+
214
214
+
fn print_all() {
215
215
+
let db = Db::new(DbConfig::default(), CancellationToken::new()).expect("couldnt create db");
216
216
+
let nsids = db.get_nsids().collect::<Vec<_>>();
217
217
+
let mut count = 0_usize;
218
218
+
for nsid in nsids {
219
219
+
println!("{}:", nsid.deref());
220
220
+
for hit in db.get_hits(&nsid, .., usize::MAX) {
221
221
+
let hit = hit.expect("aaa");
222
222
+
println!("{} {}", hit.timestamp, hit.deser().unwrap().deleted);
223
223
+
count += 1;
224
224
+
}
225
225
+
}
226
226
+
println!("total hits: {}", count);
208
227
}
209
228
210
229
fn debug() {