Quiet html5ever, shuffle servers, mobile scaling

This commit is contained in:
asonix
2020-03-26 11:17:59 -05:00
parent bcfe8b14a3
commit d445177c69
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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")
+3 -1
View File
@@ -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<State>,
config: web::Data<Config>,
) -> Result<HttpResponse, MyError> {
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)?;