mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-04 23:53:45 +08:00
refactor(CoreManager) combine duplicated logical
This commit is contained in:
parent
3ec77c6256
commit
8fdcffc731
@ -480,14 +480,7 @@ impl CoreManager {
|
|||||||
|
|
||||||
pub async fn init(&self) -> Result<()> {
|
pub async fn init(&self) -> Result<()> {
|
||||||
logging!(trace, Type::Core, "Initializing core");
|
logging!(trace, Type::Core, "Initializing core");
|
||||||
if service::is_service_available().await.is_ok() {
|
self.start_core().await?;
|
||||||
if service::check_service_needs_reinstall().await {
|
|
||||||
service::reinstall_service().await?;
|
|
||||||
}
|
|
||||||
self.start_core_by_service().await?;
|
|
||||||
} else {
|
|
||||||
self.start_core_by_sidecar().await?;
|
|
||||||
}
|
|
||||||
logging!(trace, Type::Core, "Initied core");
|
logging!(trace, Type::Core, "Initied core");
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
log_err!(Tray::global().subscribe_traffic().await);
|
log_err!(Tray::global().subscribe_traffic().await);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user