refactor: replace isServiceAvailable with getRunningMode for service status checks

This commit is contained in:
Tunglies
2025-05-26 16:08:16 +08:00
parent 2b89f07fe5
commit 32ee1b36d2
6 changed files with 61 additions and 125 deletions

View File

@@ -2,8 +2,10 @@ use super::CmdResult;
use crate::module::mihomo::MihomoManager;
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Duration, Instant};
use std::{
sync::atomic::{AtomicBool, Ordering},
time::{Duration, Instant},
};
static LAST_REFRESH_TIME: Lazy<Mutex<Option<Instant>>> = Lazy::new(|| Mutex::new(None));
static IS_REFRESHING: AtomicBool = AtomicBool::new(false);