Dont auto-update the list

This commit is contained in:
Sakuhl 2018-03-20 11:41:17 +01:00
parent c4cc584c29
commit ba14bb8d50

View File

@ -32,13 +32,8 @@ fn list() -> String {
json json
} }
fn main() { #[get("/update-list")]
let server_handle = thread::Builder::new() fn update_list() -> String {
.spawn(|| {
rocket::ignite().mount("/", routes![list]).launch()
})
.unwrap();
if let Ok(guild_list) = wynncraft::guild_list() { if let Ok(guild_list) = wynncraft::guild_list() {
let conn = establish_connection(); let conn = establish_connection();
@ -72,6 +67,14 @@ fn main() {
println!("Guilds updated!"); 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(); server_handle.join().unwrap();
} }