fixes related to recent tokio changes (#640)

This commit is contained in:
Yeastplume
2022-01-17 09:33:08 +00:00
committed by GitHub
parent 4c81e4a693
commit f5dbed2014
2 changed files with 14 additions and 5 deletions
+7 -3
View File
@@ -319,9 +319,13 @@ impl Client {
if Handle::try_current().is_ok() {
let rt = RUNTIME.clone();
let client = self.clone();
std::thread::spawn(move || rt.lock().unwrap().block_on(client.send_request_async(req)))
.join()
.unwrap()
std::thread::spawn(move || {
rt.lock()
.unwrap()
.block_on(async { client.send_request_async(req).await })
})
.join()
.unwrap()
} else {
RUNTIME
.lock()