mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
Add AsyncHandler for wrapping task spawning
This commit is contained in:
@@ -5,6 +5,7 @@ use crate::{
|
||||
core::*,
|
||||
logging, logging_error,
|
||||
module::lightweight,
|
||||
process::AsyncHandler,
|
||||
utils::{error, init, logging::Type, server},
|
||||
wrap_err,
|
||||
};
|
||||
@@ -211,7 +212,7 @@ pub fn create_window(is_showup: bool) {
|
||||
|
||||
// 标记前端UI已准备就绪,向前端发送启动完成事件
|
||||
let app_handle_clone = app_handle.clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
AsyncHandler::spawn(move || async move {
|
||||
use tauri::Emitter;
|
||||
|
||||
logging!(info, Type::Window, true, "UI gets ready.");
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user