From 1e4856534be7799bf8f04983b7f6213a314727e8 Mon Sep 17 00:00:00 2001 From: musitdev Date: Wed, 17 Jan 2024 14:41:49 +0100 Subject: [PATCH] add timeout before closing the http server --- crates/cli/src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/server.rs b/crates/cli/src/server.rs index 11a22b5c..7be0bdea 100644 --- a/crates/cli/src/server.rs +++ b/crates/cli/src/server.rs @@ -113,14 +113,14 @@ pub async fn serve_file( } if served_files.is_empty() { //end of the download + //wait that the http download buffer flush. + tokio::time::sleep(tokio::time::Duration::from_millis(250)).await; break; } } _ = download_started_interval.tick() => { if !download_started { log::error!("Node download didn't started in time. Local host can be unreachable from node."); - //wait that the http download buffer flush. - tokio::time::sleep(tokio::time::Duration::from_millis(250)).await; break; } }