mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
fix(service): stop waiting on a service that no longer starts with Windows
When the service's start type was changed from automatic, startup waited about two minutes for it before falling back to Sidecar. Detect this immediately, skip the TUN readiness wait, and offer a reinstall that restores automatic start. Refs #8129
This commit is contained in:
@@ -29,11 +29,11 @@ impl RunStateEnv for RealEnv {
|
||||
async fn probe_service_version(&self) -> Result<ServiceVersionReply> {
|
||||
// The IPC client would otherwise back off for about two minutes before failing.
|
||||
#[cfg(windows)]
|
||||
if tokio::task::spawn_blocking(crate::core::service::service_stopped)
|
||||
if let Some(reason) = tokio::task::spawn_blocking(crate::core::service::service_stop_reason)
|
||||
.await
|
||||
.context("service status probe did not finish")??
|
||||
{
|
||||
anyhow::bail!("the Windows service is not running");
|
||||
anyhow::bail!(reason);
|
||||
}
|
||||
let response = clash_verge_service_ipc::get_version().await?;
|
||||
let core = if response.code == 0
|
||||
|
||||
Reference in New Issue
Block a user