Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wasm-timer to wasmtimer #202

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions reqwest-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions reqwest-retry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to gate this dependency behind cfg(target_arch = "wasm32") like we did before


[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]
Expand Down
4 changes: 1 addition & 3 deletions reqwest-retry/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading