From 471d7def84c5251fb534295cfb3cde22f1610697 Mon Sep 17 00:00:00 2001 From: Sakuhl <2012collector@gmail.com> Date: Mon, 15 Jan 2018 17:49:04 +0100 Subject: [PATCH] Keep server alive during scan --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4b0fdff..906dad9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,8 @@ use diesel::pg::PgConnection; extern crate wynncraft; +extern crate reqwest; + use std::env; use std::thread; @@ -44,13 +46,13 @@ fn main() { thread::sleep_ms(2500); println!("Getting {:?}", name); if let Ok(Some(prefix)) = wynncraft::guild(&name).map(|x| x.map(|x| x.prefix)) { - let guild = Guild { prefix, name }; + let guild = Guild { prefix: prefix.trim().to_owned(), name }; if let Ok(_) = diesel::insert_into(guilds::table) .values(&guild) .on_conflict(guilds::prefix) .do_nothing() .execute(&conn) { - + let _ = reqwest::get("https://https://wynnapi.herokuapp.com/"); } else { println!("Fail!"); }