mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 07:23:43 +08:00
feat: macos service installation query, can't avoid it, add service run check, if installation not confirmed, exit automatically after 10 seconds
This commit is contained in:
parent
df3c296850
commit
4ce7d9f7a9
@ -57,7 +57,25 @@ pub async fn resolve_setup(app: &mut App) {
|
|||||||
match service::reinstall_service().await {
|
match service::reinstall_service().await {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
log::info!(target:"app", "install service susccess.");
|
log::info!(target:"app", "install service susccess.");
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
std::thread::sleep(std::time::Duration::from_millis(1000));
|
std::thread::sleep(std::time::Duration::from_millis(1000));
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
let mut service_runing = false;
|
||||||
|
for _ in 0..20 {
|
||||||
|
if service::check_service().await.is_ok() {
|
||||||
|
service_runing = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
log::warn!(target: "app", "service not runing, sleep 500ms and check again.");
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(500));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !service_runing {
|
||||||
|
log::error!(target: "app", "service not runing. exit");
|
||||||
|
app.app_handle().exit(-2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!(target: "app", "{e:?}");
|
log::error!(target: "app", "{e:?}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user