Add AsyncHandler for wrapping task spawning

This commit is contained in:
Tunglies
2025-04-11 17:27:56 +08:00
parent 644fdc071f
commit b6a6f5f434
12 changed files with 82 additions and 52 deletions

View File

@@ -4,6 +4,7 @@ use super::resolve;
use crate::{
config::{Config, IVerge, DEFAULT_PAC},
logging_error,
process::AsyncHandler,
utils::logging::Type,
};
use anyhow::{bail, Result};
@@ -47,7 +48,7 @@ pub async fn check_singleton() -> Result<()> {
pub fn embed_server() {
let port = IVerge::get_singleton_port();
tauri::async_runtime::spawn(async move {
AsyncHandler::spawn(move || async move {
let visible = warp::path!("commands" / "visible").map(move || {
resolve::create_window(false);
"ok"