From bc650803c354630b1a871f0bddb4c6dc82124fbd Mon Sep 17 00:00:00 2001 From: Dominic Burkart <1351120+DominicBurkart@users.noreply.github.com> Date: Sat, 4 Dec 2021 23:20:16 +0100 Subject: [PATCH] fix remaining compilation errors --- turbolift_macros/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/turbolift_macros/src/lib.rs b/turbolift_macros/src/lib.rs index 55ffcf28..81ba23cf 100644 --- a/turbolift_macros/src/lib.rs +++ b/turbolift_macros/src/lib.rs @@ -85,18 +85,17 @@ pub fn on(distribution_platform_: TokenStream, function_: TokenStream) -> TokenS } #[turbolift::tracing::instrument] - async fn turbolift_wrapper(turbolift::actix_web::web::Path((#untyped_params_tokens_with_run_id)): web::Path<(#param_types)>) -> impl turbolift::actix_web::Responder { + async fn turbolift_wrapper(turbolift::actix_web::web::Path((#untyped_params_tokens_with_run_id)): turbolift::actix_web::web::Path<(#param_types)>) -> impl turbolift::actix_web::Responder { Ok( turbolift::actix_web::HttpResponse::Ok() .json(#function_name(#untyped_params_tokens)) ) } - #[turbolift::actix_web::main] #[turbolift::tracing::instrument] - async fn main() -> std::io::Result<()> { - use actix_web::{App, HttpServer, HttpRequest, web}; - + fn main() -> std::io::Result<()> { + turbolift::actix_web::rt::System::new("main".to_string()) + .block_on(async move { let args: Vec = std::env::args().collect(); let ip_and_port = &args[1]; turbolift::tracing::info!("service main() started. ip_and_port parsed."); @@ -104,7 +103,7 @@ pub fn on(distribution_platform_: TokenStream, function_: TokenStream) -> TokenS || turbolift::actix_web::App::new() .route( - #wrapper_route, turbolift::actix_web::web::get().to(turbolift_wrapper) + "#wrapper_route", turbolift::actix_web::web::get().to(turbolift_wrapper) ) .route( "/health-probe", turbolift::actix_web::web::get().to(health_probe) @@ -123,7 +122,8 @@ pub fn on(distribution_platform_: TokenStream, function_: TokenStream) -> TokenS .run() .compat() .await - } + }); + } }; // copy all files in repo into cache