Work in progress atmosphere stats viewer
1

Configure Feed

Select the types of activity you want to include in your feed.

fix(uplc): auto refresh stats every 500000 ops to help mitigate drift

+16
+16
uplc/src/plc.rs
··· 83 83 let mut total = 0; 84 84 85 85 loop { 86 + // todo this won't hold up after the backfill as it'll be slower 87 + // and we likely won't get full batches. 88 + if total % 500_000 == 0 { 89 + println!("refreshing stats at {} ops", total); 90 + 91 + tokio::task::spawn_blocking({ 92 + let db = db.clone(); 93 + let mut stats = stats.clone().write_owned().await; 94 + // todo this does make the api unavailable while it's working 95 + // as the rwlock doesn't allow any readers while a writer is open 96 + move || async move { stats.refresh(&db) } 97 + }) 98 + .await? 99 + .await?; 100 + } 101 + 86 102 println!("seen {} this session with seq {}", total, after); 87 103 let url = format!("https://plc.directory/export?count=1000&after={}", after); 88 104