mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 16:30:52 +08:00
fix: build front cannot find IvergeConfig.enable_lite_mode and macos port switching causes crash (#2691)
* fix: macos switch protocol port or enable protocol port causes crash * fix: build time front cannot find IVergeConfig attribute enable_lite_mode
This commit is contained in:
@@ -98,6 +98,7 @@ impl CoreManager {
|
||||
|
||||
/// 启动核心
|
||||
pub async fn start_core(&self) -> Result<()> {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
// 检查端口占用
|
||||
self.health_checker.check_ports().await?;
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
use anyhow::{bail, Result};
|
||||
#[cfg(target_os = "macos")]
|
||||
use anyhow::Result;
|
||||
use sysinfo::{Pid, System};
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
use crate::config::Config;
|
||||
use crate::core::service;
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
use port_scanner::local_port_available;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -12,6 +17,7 @@ impl HealthChecker {
|
||||
Self
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
pub async fn check_ports(&self) -> Result<()> {
|
||||
let verge = Config::verge();
|
||||
let verge_config = verge.latest();
|
||||
|
||||
Reference in New Issue
Block a user