We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bc8118 commit 073f245Copy full SHA for 073f245
mdbook-goals/src/team.rs
@@ -107,8 +107,18 @@ impl TeamName {
107
108
fn fetch<T>(path: &str) -> anyhow::Result<T>
109
where
110
- T: DeserializeOwned,
+ T: DeserializeOwned + Send,
111
{
112
- let url = format!("{}/{}", v1::BASE_URL, path);
113
- Ok(reqwest::blocking::get(&url)?.json()?)
+ // Run this on another thread because it can create a tokio runtime
+ // for the block reqwest API which makes tokio grouchy when that runtime is
114
+ // dropped.
115
+ std::thread::scope(|scope| {
116
+ scope
117
+ .spawn(|| {
118
+ let url = format!("{}/{}", v1::BASE_URL, path);
119
+ Ok(reqwest::blocking::get(&url)?.json()?)
120
+ })
121
+ .join()
122
+ .unwrap()
123
124
}
0 commit comments