From 442f969da06cc46559c3b536819020342f95c159 Mon Sep 17 00:00:00 2001 From: ajuvercr Date: Sat, 20 Jun 2020 11:21:41 +0200 Subject: [PATCH] rocket is launching --- backend/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index 27e540e..fb6c5aa 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -86,8 +86,8 @@ fn get_colour(value: &Value, _: &HashMap) -> tera::Result } /// Async main function, starting logger, graph and rocket -#[async_std::main] -async fn main() { +#[launch] +async fn rocket() -> rocket::Rocket { let fut = graph::set_default(); let sub = FmtSubscriber::builder() @@ -98,6 +98,7 @@ async fn main() { let pool = ThreadPool::new().unwrap(); pool.spawn_ok(fut.map(|_| ())); let gm = create_game_manager("0.0.0.0:9142", pool.clone()).await; + async_std::task::sleep(std::time::Duration::from_millis(100)).await; let mut routes = Vec::new(); routes::fuel(&mut routes); @@ -113,7 +114,6 @@ async fn main() { .manage(Games::new()) .attach(tera) .mount("/", routes) - .launch().await.unwrap(); } /// Creates the actual game_manager