From ba14bb8d50d63985bce5d81cfbab94098d0f040e Mon Sep 17 00:00:00 2001 From: Sakuhl <2012collector@gmail.com> Date: Tue, 20 Mar 2018 11:41:17 +0100 Subject: [PATCH] Dont auto-update the list --- src/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8f8504c..3150d58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,13 +32,8 @@ fn list() -> String { json } -fn main() { - let server_handle = thread::Builder::new() - .spawn(|| { - rocket::ignite().mount("/", routes![list]).launch() - }) - .unwrap(); - +#[get("/update-list")] +fn update_list() -> String { if let Ok(guild_list) = wynncraft::guild_list() { let conn = establish_connection(); @@ -72,6 +67,14 @@ fn main() { println!("Guilds updated!"); } +} + +fn main() { + let server_handle = thread::Builder::new() + .spawn(|| { + rocket::ignite().mount("/", routes![list, update_list]).launch() + }) + .unwrap(); server_handle.join().unwrap(); }