From abf66740435b4cbf530cf33a7fd6e609e3e6fd5c Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Fri, 22 Nov 2024 17:46:29 +0800 Subject: [PATCH] fix(liveman): node delay always is 0ms --- liveman/src/store.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/liveman/src/store.rs b/liveman/src/store.rs index 9b65c33..37c33a3 100644 --- a/liveman/src/store.rs +++ b/liveman/src/store.rs @@ -281,13 +281,13 @@ impl Storage { let handles = requests .into_iter() .map(|(alias, value)| { - tokio::spawn(async move { (alias, start.elapsed(), value.await) }) + tokio::spawn(async move { (alias, value.await, start.elapsed()) }) }) .collect::, + std::time::Duration, )>, >>(); @@ -307,7 +307,7 @@ impl Storage { for handle in handles { let result = tokio::join!(handle); match result { - (Ok((alias, duration, Ok(res))),) => { + (Ok((alias, Ok(res), duration)),) => { debug!( "{}: spend time: [{:?}] Response: {:?}", alias, duration, res @@ -325,7 +325,7 @@ impl Storage { Err(e) => error!("Error: {:?}", e), }; } - (Ok((name, duration, Err(e))),) => { + (Ok((name, Err(e), duration)),) => { error!("{}: spend time: [{:?}] Error: {:?}", name, duration, e); } _ => {}