Skip to content

Commit

Permalink
fix(liveman): node delay always is 0ms
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 22, 2024
1 parent c6ebb2f commit abf6674
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions liveman/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<
tokio::task::JoinHandle<(
std::string::String,
std::time::Duration,
std::result::Result<reqwest::Response, reqwest::Error>,
std::time::Duration,
)>,
>>();

Expand All @@ -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
Expand All @@ -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);
}
_ => {}
Expand Down

0 comments on commit abf6674

Please sign in to comment.