feat: enhance auto log cleaning options with 1-day retention and update related configurations

This commit is contained in:
Tunglies
2025-05-20 22:33:46 +08:00
parent 7cd1816866
commit 4024b72954
5 changed files with 19 additions and 9 deletions

View File

@@ -134,7 +134,7 @@ pub struct IVerge {
pub test_list: Option<Vec<IVergeTestItem>>,
/// 日志清理
/// 0: 不清理; 1: 7天; 2: 30天; 3: 90天
/// 0: 不清理; 1: 1天2: 7天; 3: 30天; 4: 90天
pub auto_log_clean: Option<i32>,
/// 是否启用随机端口

View File

@@ -317,9 +317,13 @@ impl Handle {
let system_opt = handle.notification_system.read();
if let Some(system) = system_opt.as_ref() {
system.send_event(FrontendEvent::ProfileChanged { current_profile_id: profile_id });
system.send_event(FrontendEvent::ProfileChanged {
current_profile_id: profile_id,
});
} else {
log::warn!("Notification system not initialized when trying to send ProfileChanged event.");
log::warn!(
"Notification system not initialized when trying to send ProfileChanged event."
);
}
}
@@ -333,7 +337,9 @@ impl Handle {
if let Some(system) = system_opt.as_ref() {
system.send_event(FrontendEvent::TimerUpdated { profile_index });
} else {
log::warn!("Notification system not initialized when trying to send TimerUpdated event.");
log::warn!(
"Notification system not initialized when trying to send TimerUpdated event."
);
}
}
@@ -347,7 +353,9 @@ impl Handle {
if let Some(system) = system_opt.as_ref() {
system.send_event(FrontendEvent::StartupCompleted);
} else {
log::warn!("Notification system not initialized when trying to send StartupCompleted event.");
log::warn!(
"Notification system not initialized when trying to send StartupCompleted event."
);
}
}