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

self_update uses reqwest::blocking #1152

Closed
etam opened this issue Mar 16, 2021 · 2 comments
Closed

self_update uses reqwest::blocking #1152

etam opened this issue Mar 16, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@etam
Copy link
Contributor

etam commented Mar 16, 2021

Calls to self_update must be wrapped in tokio::task::spawn_blocking.

https://docs.rs/reqwest/0.11.2/reqwest/blocking/index.html

Conversely, the functionality in reqwest::blocking must not be executed within an async runtime, or it will panic when attempting to block. If calling directly from an async function, consider using an async reqwest::Client instead. If the immediate context is only synchronous, but a transitive caller is async, consider changing that caller to use tokio::task::spawn_blocking around the calls that need to block.

@etam etam added the bug Something isn't working label Mar 16, 2021
@tworec
Copy link
Contributor

tworec commented Mar 16, 2021

We are using 0.11.0 and for it documentation does not state that it will panic
https://docs.rs/reqwest/0.11.0/reqwest/blocking/index.html

@etam
Copy link
Contributor Author

etam commented Mar 16, 2021

because warning was added later: seanmonstar/reqwest#1159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants