Refactor async runtime usage with AsyncHandler wrapper

This commit is contained in:
Tunglies
2025-04-11 17:47:08 +08:00
parent b6a6f5f434
commit 51ef1329be
7 changed files with 55 additions and 38 deletions

View File

@@ -86,7 +86,7 @@ impl AppHandleManager {
#[allow(clippy::panic)]
pub fn run() {
// 单例检测
let app_exists: bool = tauri::async_runtime::block_on(async move {
let app_exists: bool = AsyncHandler::block_on(move || async move {
if server::check_singleton().await.is_err() {
println!("app exists");
true
@@ -134,7 +134,7 @@ pub fn run() {
});
});
tauri::async_runtime::block_on(async move {
AsyncHandler::block_on(move || async move {
resolve::resolve_setup(app).await;
});