feat: initial and restart core checks service version if available

chore: update UPDATELOG.md
This commit is contained in:
Tunglies
2025-03-27 09:20:15 +08:00
parent 971dd6a2cf
commit a6a6d9d036
2 changed files with 17 additions and 7 deletions

View File

@@ -480,10 +480,13 @@ impl CoreManager {
pub async fn init(&self) -> Result<()> {
logging!(trace, Type::Core, "Initializing core");
if is_service_available().await.is_ok() {
Self::global().start_core_by_service().await?;
if service::is_service_available().await.is_ok() {
if service::check_service_needs_reinstall().await {
service::reinstall_service().await?;
}
self.start_core_by_service().await?;
} else {
Self::global().start_core_by_sidecar().await?;
self.start_core_by_sidecar().await?;
}
logging!(trace, Type::Core, "Initied core");
#[cfg(target_os = "macos")]
@@ -503,7 +506,10 @@ impl CoreManager {
/// 启动核心
pub async fn start_core(&self) -> Result<()> {
if is_service_available().await.is_ok() {
if service::is_service_available().await.is_ok() {
if service::check_service_needs_reinstall().await {
service::reinstall_service().await?;
}
self.start_core_by_service().await?;
} else {
self.start_core_by_sidecar().await?;