From 242a6d13afe98bdd796193f7fc855fdf664ec0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Wed, 14 Sep 2022 16:24:05 +0200 Subject: [PATCH] gateway-client: fix shutdown --- common/client-libs/gateway-client/src/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/client-libs/gateway-client/src/client.rs b/common/client-libs/gateway-client/src/client.rs index 2c6226a013..e859822226 100644 --- a/common/client-libs/gateway-client/src/client.rs +++ b/common/client-libs/gateway-client/src/client.rs @@ -309,6 +309,8 @@ impl GatewayClient { async { if let Some(mut s) = m_shutdown { s.recv().await + } else { + std::future::pending::<()>().await } } .fuse() @@ -317,7 +319,7 @@ impl GatewayClient { tokio::pin!(shutdown); #[cfg(target_arch = "wasm32")] - let mut shutdown = Box::pin(async {}.fuse()); + let mut shutdown = std::future::pending::<()>().fuse(); loop { futures::select! {