From 9b2729b9091533afce072e562a9fe53ebe2695cd Mon Sep 17 00:00:00 2001 From: Elder Ryan Date: Thu, 16 Nov 2023 22:59:42 +0800 Subject: [PATCH] bugfix: fixed timeout in wasm stabilazation (#495) * fixed timeout * bump version to 0.3.5 --- Cargo.toml | 2 +- core/src/dht/stabilization.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ae5113c2..819a572d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["core", "transport", "node", "rpc", "derive"] [workspace.package] -version = "0.3.4" +version = "0.3.5" edition = "2021" license = "GPL-3.0" authors = ["RND "] diff --git a/core/src/dht/stabilization.rs b/core/src/dht/stabilization.rs index 2f08c5cd3..ff3677dfa 100644 --- a/core/src/dht/stabilization.rs +++ b/core/src/dht/stabilization.rs @@ -234,6 +234,7 @@ mod stabilizer { impl TStabilize for Stabilization { async fn wait(self: Arc) { let caller = Arc::clone(&self); + let timeout = caller.timeout; let func = move || { let caller = caller.clone(); spawn_local(Box::pin(async move { @@ -243,7 +244,7 @@ mod stabilizer { .unwrap_or_else(|e| tracing::error!("failed to stabilize {:?}", e)); })) }; - poll!(func, 25000); + poll!(func, (timeout / 1000).try_into().unwrap()); } } }