update wasm-timer to wasmtimer

This commit is contained in:
Peerat Vichivanives 2024-11-26 16:16:25 -08:00
parent 8a494c1657
commit 4b3140e1e6
3 changed files with 6 additions and 5 deletions

View file

@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Updated `wasm-timer` to `wasmtimer`
## [0.4.0] - 2024-11-08
### Breaking Changes

View file

@ -24,14 +24,14 @@ reqwest = { version = "0.12.0", default-features = false }
retry-policies = "0.4"
thiserror = "1.0.61"
tracing = { version = "0.1.26", optional = true }
wasmtimer = "0.4.1"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
hyper = "1.0"
tokio = { version = "1.6.0", default-features = false, features = ["time"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
parking_lot = { version = "0.11.2", features = ["wasm-bindgen"] } # work around https://github.com/tomaka/wasm-timer/issues/14
wasm-timer = "0.2.5"
getrandom = { version = "0.2.0", features = ["js"] }
[dev-dependencies]

View file

@ -177,9 +177,7 @@ where
#[cfg(not(target_arch = "wasm32"))]
tokio::time::sleep(duration).await;
#[cfg(target_arch = "wasm32")]
wasm_timer::Delay::new(duration)
.await
.expect("failed sleeping");
wasmtimer::tokio::sleep(duration).await;
n_past_retries += 1;
continue;