fix: improve Service connection method and permissions for Windows and Unix

This commit is contained in:
Tunglies
2025-10-11 23:40:37 +08:00
parent 4f1d61a56e
commit d531432f4a
16 changed files with 535 additions and 779 deletions

View File

@@ -870,7 +870,6 @@ impl CoreManager {
}
pub async fn prestart_core(&self) -> Result<()> {
SERVICE_MANAGER.lock().await.refresh().await?;
match SERVICE_MANAGER.lock().await.current() {
ServiceStatus::Ready => {
self.set_running_mode(RunningMode::Service);
@@ -912,6 +911,9 @@ impl CoreManager {
pub async fn restart_core(&self) -> Result<()> {
logging!(info, Type::Core, "Restarting core");
self.stop_core().await?;
if SERVICE_MANAGER.lock().await.init().await.is_ok() {
logging_error!(Type::Setup, SERVICE_MANAGER.lock().await.refresh().await);
}
self.start_core().await?;
Ok(())
}