From 53289b69e5037700689665b4edf20f2382ff15f6 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 11 Apr 2020 18:51:11 +0200 Subject: Background task runner that replaces tokio::spawn --- src/rpc_server.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/rpc_server.rs') diff --git a/src/rpc_server.rs b/src/rpc_server.rs index cbcfac79..98798614 100644 --- a/src/rpc_server.rs +++ b/src/rpc_server.rs @@ -90,7 +90,7 @@ async fn handler( pub async fn run_rpc_server( garage: Arc, shutdown_signal: impl Future, -) -> Result<(), hyper::Error> { +) -> Result<(), Error> { let bind_addr = ([0, 0, 0, 0], garage.system.config.rpc_port).into(); let service = make_service_fn(|conn: &AddrStream| { @@ -112,5 +112,6 @@ pub async fn run_rpc_server( let graceful = server.with_graceful_shutdown(shutdown_signal); println!("RPC server listening on http://{}", bind_addr); - graceful.await + graceful.await?; + Ok(()) } -- cgit v1.2.3