fix crash when future cancelled
This commit is contained in:
parent
4a5b4c055f
commit
68e154aa08
2 changed files with 9 additions and 6 deletions
|
@ -51,7 +51,9 @@ cargo_env = environment()
|
|||
cargo_env.set('MESON_BUILD_ROOT', meson.project_build_root())
|
||||
cargo_env.set('CARGO_MANIFEST_DIR', meson.project_source_root())
|
||||
cargo_env.set('CARGO_TARGET_DIR', meson.project_build_root() / 'target')
|
||||
meson.add_devenv(cargo_env)
|
||||
dev_env = cargo_env
|
||||
dev_env.set('RUST_BACKTRACE', 'full')
|
||||
meson.add_devenv(dev_env)
|
||||
|
||||
custom_target(
|
||||
'cargo-build',
|
||||
|
|
|
@ -204,16 +204,17 @@ impl Client {
|
|||
})
|
||||
}
|
||||
|
||||
sender
|
||||
.send(perform(future.await).await)
|
||||
.await
|
||||
.expect("could not send subsonic response back to the main loop");
|
||||
sender.send(perform(future.await).await).await.map_err(|_| {
|
||||
Error::OtherError(
|
||||
"failed to send back response from tokio request (future probably cancelled)",
|
||||
)
|
||||
})
|
||||
});
|
||||
|
||||
receiver
|
||||
.recv()
|
||||
.await
|
||||
.expect("could not receive subsonic response from tokio")
|
||||
.map_err(|_| Error::OtherError("failed to receive response from tokio loop"))?
|
||||
}
|
||||
|
||||
fn url(&self, path: &[&str], query: &[(&str, &str)]) -> url::Url {
|
||||
|
|
Loading…
Reference in a new issue