refactor: streamline resolve_scheme function calls and visibility in utils

This commit is contained in:
Tunglies
2025-08-30 17:22:52 +08:00
parent 09f14c23e4
commit 3a7be3dfb7
4 changed files with 19 additions and 13 deletions

View File

@@ -1,3 +1,4 @@
use anyhow::Result;
use tauri::AppHandle;
use crate::{
@@ -32,9 +33,10 @@ pub fn resolve_setup_async() {
std::thread::current().id()
);
AsyncHandler::spawn_blocking(|| AsyncHandler::block_on(init_work_config()));
AsyncHandler::spawn(|| async {
init_resources().await;
init_work_config().await;
init_startup_script().await;
init_timer().await;
@@ -45,7 +47,6 @@ pub fn resolve_setup_async() {
init_core_manager().await;
init_system_proxy().await;
// 在单独的 spawn 中运行 sync 函数,避免 Send 问题
AsyncHandler::spawn_blocking(|| {
init_system_proxy_guard();
});
@@ -106,6 +107,18 @@ pub(super) fn init_scheme() {
logging_error!(Type::Setup, true, init::init_scheme());
}
pub async fn resolve_scheme(param: String) -> Result<()> {
logging!(
info,
Type::Setup,
true,
"Resolving scheme for param: {}",
param
);
logging_error!(Type::Setup, true, scheme::resolve_scheme(param).await);
Ok(())
}
pub(super) fn init_embed_server() {
logging!(info, Type::Setup, true, "Initializing embedded server...");
server::embed_server();