From d445177c69ca7fa9dcbad4facfd5501f0f8866db Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 26 Mar 2020 11:17:59 -0500 Subject: [PATCH] Quiet html5ever, shuffle servers, mobile scaling --- src/main.rs | 2 +- src/routes/index.rs | 4 +++- templates/index.rs.html | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index bd88a12..266c598 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ async fn main() -> Result<(), anyhow::Error> { if config.debug() { std::env::set_var( "RUST_LOG", - "debug,tokio_postgres=info,h2=info,trust_dns_resolver=info,trust_dns_proto=info,rustls=info", + "debug,tokio_postgres=info,h2=info,trust_dns_resolver=info,trust_dns_proto=info,rustls=info,html5ever=info", ) } else { std::env::set_var("RUST_LOG", "info") diff --git a/src/routes/index.rs b/src/routes/index.rs index 6d9e564..3271de8 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -1,13 +1,15 @@ use crate::{config::Config, data::State, error::MyError}; use actix_web::{web, HttpResponse}; use log::error; +use rand::{seq::SliceRandom, thread_rng}; use std::io::BufWriter; pub async fn route( state: web::Data, config: web::Data, ) -> Result { - let nodes = state.node_cache().nodes().await; + let mut nodes = state.node_cache().nodes().await; + nodes.shuffle(&mut thread_rng()); let mut buf = BufWriter::new(Vec::new()); crate::templates::index(&mut buf, &nodes, &config)?; diff --git a/templates/index.rs.html b/templates/index.rs.html index e764185..dee297e 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -9,7 +9,8 @@ - + + @config.hostname() | ActivityPub Relay