refactor: clean up unused backend code

This commit is contained in:
Tunglies
2026-08-15 00:07:48 +08:00
parent 22947632c0
commit 49f638414b
4 changed files with 2 additions and 24 deletions
+1 -5
View File
@@ -10,8 +10,6 @@ use tauri_plugin_mihomo::models::WsConnectionId;
/// 托盘速率流异常后的重连间隔。
const TRAY_SPEED_RETRY_DELAY: Duration = Duration::from_secs(1);
/// 托盘速率流运行时的空闲轮询间隔。
const TRAY_SPEED_IDLE_POLL_INTERVAL: Duration = Duration::from_millis(200);
/// 托盘速率流在此时间内收不到有效数据时,触发重连并降级到 0/0。
const TRAY_SPEED_STALE_TIMEOUT: Duration = Duration::from_secs(5);
@@ -88,9 +86,7 @@ impl TraySpeedController {
loop {
let next_state = speed_stream
.next_event(TRAY_SPEED_IDLE_POLL_INTERVAL, TRAY_SPEED_STALE_TIMEOUT, || {
handle::Handle::global().is_exiting()
})
.next_event(TRAY_SPEED_STALE_TIMEOUT, || handle::Handle::global().is_exiting())
.await;
match next_state {