Skip to content

Commit 7ecf856

Browse files
committed
refactor: remove unnecessary logging statements in scheduler tasks
1 parent a8609e7 commit 7ecf856

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

src-tauri/src/scheduler/executor.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ impl SchedulerState {
158158

159159
loop {
160160
interval.tick().await;
161-
info!("执行仪表盘刷新任务");
162161

163162
// 通知前端刷新仪表盘
164163
if let Some(window) = app_handle.as_ref().get_webview_window("main") {
@@ -218,8 +217,6 @@ impl SchedulerState {
218217

219218
loop {
220219
interval.tick().await;
221-
info!("执行账户使用限制检查任务");
222-
223220
// 执行账户检查
224221
if let Err(e) = tasks::check_account_limit(&app_handle).await {
225222
error!("检查账户使用限制失败: {}", e);

src-tauri/src/scheduler/tasks.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ use crate::cursor_reset::commands;
44
use crate::utils::ErrorReporter;
55
use serde_json::Value;
66
use tauri::{AppHandle, Emitter, Manager};
7-
use tracing::{error, info};
7+
use tracing::error;
88
use crate::database::Database;
99

1010
/// 检查账户使用限制
1111
pub async fn check_account_limit(app_handle: &AppHandle) -> Result<(), String> {
12-
info!("检查账户使用限制");
13-
1412
// 获取当前机器码和用户信息
1513
let machine_info = match commands::get_machine_ids() {
1614
Ok(info) => info,
@@ -122,15 +120,11 @@ pub async fn check_account_limit(app_handle: &AppHandle) -> Result<(), String> {
122120
}
123121
}
124122
}
125-
126-
info!("账户使用限制检查完成");
127123
Ok(())
128124
}
129125

130126
/// 发送通知到前端
131127
async fn send_notification(app_handle: &AppHandle, account: &str, remaining_percentage: i64) -> Result<(), String> {
132-
info!("发送账户使用量警告事件");
133-
134128
// 只向前端发送账户数据和剩余使用量百分比
135129
if let Some(window) = app_handle.get_webview_window("main") {
136130
if let Err(e) = window.emit("account-usage-warning",
@@ -145,8 +139,6 @@ async fn send_notification(app_handle: &AppHandle, account: &str, remaining_perc
145139
error!("{}", err_msg);
146140
return Err(err_msg);
147141
}
148-
149-
info!("通知事件发送成功");
150142
Ok(())
151143
} else {
152144
let err_msg = "无法获取应用窗口,通知发送失败".to_string();

0 commit comments

Comments
 (0)