Remove instance filtering/sorting
This commit is contained in:
parent
71cdf40bae
commit
f3876b4745
1 changed files with 1 additions and 12 deletions
11
src/main.rs
11
src/main.rs
|
@ -15,7 +15,6 @@ pub async fn main() -> Result<(), Error> {
|
||||||
|
|
||||||
eprintln!("Crawling...");
|
eprintln!("Crawling...");
|
||||||
let instance_details = crawl(start_instances).await?;
|
let instance_details = crawl(start_instances).await?;
|
||||||
let instance_details = cleanup(instance_details);
|
|
||||||
let total_stats = aggregate(instance_details);
|
let total_stats = aggregate(instance_details);
|
||||||
|
|
||||||
println!("{}", serde_json::to_string(&total_stats)?);
|
println!("{}", serde_json::to_string(&total_stats)?);
|
||||||
|
@ -47,16 +46,6 @@ fn aggregate(instance_details: Vec<InstanceDetails>) -> TotalStats {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cleanup(instance_details: Vec<InstanceDetails>) -> Vec<InstanceDetails> {
|
|
||||||
let mut instance_details: Vec<InstanceDetails> = instance_details
|
|
||||||
.iter()
|
|
||||||
.filter(|i| i.open_registrations)
|
|
||||||
.map(|i| i.to_owned())
|
|
||||||
.collect();
|
|
||||||
instance_details.sort_by(|a, b| b.users_active_halfyear.cmp(&a.users_active_halfyear));
|
|
||||||
instance_details
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn crawl(start_instances: Vec<String>) -> Result<Vec<InstanceDetails>, Error> {
|
async fn crawl(start_instances: Vec<String>) -> Result<Vec<InstanceDetails>, Error> {
|
||||||
let mut pending_instances = start_instances;
|
let mut pending_instances = start_instances;
|
||||||
let mut instance_details = vec![];
|
let mut instance_details = vec![];
|
||||||
|
|
Loading…
Reference in a new issue