diff --git a/core/codegen/src/attribute/entry/launch.rs b/core/codegen/src/attribute/entry/launch.rs index 65834a9b..f3081e3a 100644 --- a/core/codegen/src/attribute/entry/launch.rs +++ b/core/codegen/src/attribute/entry/launch.rs @@ -42,6 +42,11 @@ impl EntryAttr for Launch { ___rocket }); + let launch = match f.sig.asyncness { + Some(_) => quote_spanned!(ty.span() => async move { #rocket.launch().await }), + None => quote_spanned!(ty.span() => #rocket.launch()), + }; + let (vis, mut sig) = (&f.vis, f.sig.clone()); sig.ident = syn::Ident::new("main", sig.ident.span()); sig.output = syn::ReturnType::Default; @@ -51,7 +56,7 @@ impl EntryAttr for Launch { #[allow(dead_code)] #f #vis #sig { - ::rocket::async_main(async move { let _res = #rocket.launch().await; }) + let _ = ::rocket::async_main(#launch); } )) } diff --git a/core/lib/src/server.rs b/core/lib/src/server.rs index 5a71c5bb..c2a62ca9 100644 --- a/core/lib/src/server.rs +++ b/core/lib/src/server.rs @@ -529,13 +529,13 @@ impl Rocket { Ok(rocket) } Err(rocket) => { - warn!("Server failed to shutdown cooperatively."); + warn!("Shutdown failed: outstanding background I/O."); Err(Error::shutdown(rocket, None)) } } } _ = &mut shutdown_timer => { - warn!("Server failed to shutdown cooperatively."); + warn!("Shutdown failed: server executing after timeouts."); return Err(Error::shutdown(rocket.clone(), None)); }, }