mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: improve code formatting and enhance logging in resolve_setup_async function
This commit is contained in:
@@ -31,8 +31,8 @@ use std::time::Instant;
|
||||
use std::{error::Error, fmt, path::PathBuf, sync::Arc, time::Duration};
|
||||
use tauri_plugin_mihomo::Error as MihomoError;
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
use tokio::time::sleep;
|
||||
use tokio::sync::Semaphore;
|
||||
use tokio::time::sleep;
|
||||
|
||||
// TODO:
|
||||
// - 重构,提升模式切换速度
|
||||
@@ -136,7 +136,8 @@ impl CoreManager {
|
||||
Err(e)
|
||||
}
|
||||
}
|
||||
}.await;
|
||||
}
|
||||
.await;
|
||||
|
||||
drop(permit);
|
||||
result
|
||||
|
||||
@@ -86,7 +86,12 @@ pub fn resolve_setup_async() {
|
||||
});
|
||||
|
||||
let elapsed = start_time.elapsed();
|
||||
logging!(info, Type::Setup, "异步设置任务启动完成,耗时: {:?}", elapsed);
|
||||
logging!(
|
||||
info,
|
||||
Type::Setup,
|
||||
"异步设置任务启动完成,耗时: {:?}",
|
||||
elapsed
|
||||
);
|
||||
|
||||
if elapsed.as_secs() > 10 {
|
||||
logging!(warn, Type::Setup, "异步设置任务耗时较长({:?})", elapsed);
|
||||
|
||||
Reference in New Issue
Block a user