19 Commits

Author SHA1 Message Date
Tunglies
7fa1767645 feat: implement auto lightweight mode timer functionality
This commit implements the automatic lightweight mode feature with timer functionality:

- Rename configuration properties from auto_enter_lite_mode to enable_auto_light_weight_mode and auto_enter_lite_mode_delay to auto_light_weight_minutes for better clarity
- Add window event listeners to detect when window is closed or gets focus
- Implement timer system to automatically enter lightweight mode after configured time
- Remove exit_lightweight_mode function as it's no longer needed with the new implementation
- Update UI components to reflect the new property names
- Add logging for lightweight mode operations
- Initialize lightweight mode based on user configuration at startup

The feature now allows users to set a timer that will automatically enter lightweight mode
after closing the main window, which can be cancelled by focusing the window again.
2025-03-20 06:01:38 +08:00
Tunglies
e16b23946a refactor(timer): improve timer management with robust error handling
This commit improves the timer management system with the following enhancements:

Replace Mutex with RwLock for better read concurrency in timer state
Add structured TimerTask type to store task metadata
Use atomic boolean for initialization flag instead of mutex
Implement comprehensive error handling with detailed logging
Add rollback capability when task operations fail
Reduce lock contention by generating task diffs outside locks
Add timing metrics for task execution
Improve code organization and documentation
2025-03-15 18:58:12 +08:00
Tunglies
a7f66c3d65 chore: git hooks for linter and formatter 2025-03-13 12:51:20 +08:00
MaqicXu
6ea79daf73
refactor(timer): enhance timer initialization and task handling (#2956)
- Add initialization flag to prevent duplicate timer initialization
- Improve logging for better debugging and monitoring
- Refactor async task function with proper error handling
- Add more detailed log messages throughout the timer lifecycle
2025-03-12 22:36:25 +08:00
wonfen
52627575ff feat: Enhance configuration validation and error handling
- Improve config validation process with detailed logging and error tracking
- Add more robust error handling in profile updates and config patches
- Implement comprehensive config validation using clash core subprocess
2025-02-23 10:53:09 +08:00
MystiPanda
4d2474226b refactor: cargo clippy 2024-01-10 17:36:35 +08:00
GyDi
2667ed13f1
refactor: done 2022-11-18 18:18:41 +08:00
GyDi
63b474a32c
refactor: wip 2022-11-17 17:07:13 +08:00
GyDi
d2852bb34a
refactor: fix 2022-11-14 01:45:58 +08:00
GyDi
b03c52a501
refactor: wip 2022-11-14 01:26:33 +08:00
GyDi
4668be6e24
chore: format rust code 2022-11-12 11:37:23 +08:00
GyDi
47c8ccb0e5
refactor: optimize 2022-09-11 20:58:55 +08:00
GyDi
3242efb1a2
fix: reduce unsafe unwrap 2022-08-23 15:19:04 +08:00
FoundTheWOUT
30f9f1a021 fix: timer restore at app launch 2022-08-23 10:35:36 +08:00
GyDi
7f6dac4271
feat: refactor 2022-08-12 03:20:55 +08:00
GyDi
4f6fceb87f
feat: improve log rule 2022-07-17 17:39:44 +08:00
GyDi
cb661aaebd
feat: add update interval 2022-04-21 14:26:41 +08:00
GyDi
4de944b41e
feat: supports cron update profiles 2022-04-20 20:37:16 +08:00
GyDi
697c25015e
refactor: wip 2022-04-19 01:41:20 +08:00