From 7d21abd5c1502abbe5a6e2c10f7e3bb1b26bb994 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Wed, 26 Aug 2026 11:13:09 +0200 Subject: [PATCH] Run desktop startup on blocking pool --- Cargo.lock | 1 + apps/desktop/Cargo.toml | 1 + apps/desktop/src/main.rs | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e62b9ba..79bcfb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5434,6 +5434,7 @@ dependencies = [ "muda", "rfd", "tempfile", + "tokio", "url", "zeroize", ] diff --git a/apps/desktop/Cargo.toml b/apps/desktop/Cargo.toml index 0b35c27..5ee9c8a 100644 --- a/apps/desktop/Cargo.toml +++ b/apps/desktop/Cargo.toml @@ -30,6 +30,7 @@ path = "src/main.rs" [dependencies] iced.workspace = true ironstorage = { workspace = true, features = ["ssh"] } +tokio.workspace = true zeroize.workspace = true [target.'cfg(target_os = "macos")'.dependencies] diff --git a/apps/desktop/src/main.rs b/apps/desktop/src/main.rs index 7238a7e..e8a397f 100644 --- a/apps/desktop/src/main.rs +++ b/apps/desktop/src/main.rs @@ -6275,9 +6275,13 @@ fn parse_generation_length(value: &str) -> Result, String> async fn load_authentication() -> Result<(DesktopStorage, NativeAuthenticationSession, KeyInfo), String> { - DesktopStorage::system() - .map(|bootstrap| bootstrap.into_parts()) - .map_err(|error| error.to_string()) + tokio::task::spawn_blocking(|| { + DesktopStorage::system() + .map(|bootstrap| bootstrap.into_parts()) + .map_err(|error| error.to_string()) + }) + .await + .map_err(|error| format!("desktop startup task failed: {error}"))? } fn load_document(