From a9864e5bd0382ea9e850edbe14ff8ef321d7beec Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 26 Mar 2025 02:50:25 +1100 Subject: [PATCH] refactor(rust): tell Tauri to use our existing runtime (#8514) Tauri needs a tokio runtime in order to spawn tasks. If we don't supply one, it will start its own runtime. Given that we already start a runtime, this is unnecessary. --- rust/gui-client/src-tauri/src/client/gui.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/gui-client/src-tauri/src/client/gui.rs b/rust/gui-client/src-tauri/src/client/gui.rs index 74ad186f8..f78f87605 100644 --- a/rust/gui-client/src-tauri/src/client/gui.rs +++ b/rust/gui-client/src-tauri/src/client/gui.rs @@ -131,6 +131,8 @@ pub(crate) fn run( ) -> Result<()> { // Needed for the deep link server let rt = tokio::runtime::Runtime::new().context("Couldn't start Tokio runtime")?; + tauri::async_runtime::set(rt.handle().clone()); + let _guard = rt.enter(); // Make sure we're single-instance