21 Commits

Author SHA1 Message Date
Tunglies
0b8d08d13b Update logging macros usage in timer module
Replace log macros with custom logging macros in timer module
2025-04-05 11:36:38 +08:00
Tunglies
0de304d4e3 Fix and Optimize
fix: #3187 and #3096, silent startup can not trigger lightweight mode
fix: optimize startup initializing processing
2025-04-05 10:28:27 +08:00
Tunglies
81b5501b0e 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
36142656a4 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
b57c6e408a chore: git hooks for linter and formatter 2025-03-13 12:51:20 +08:00
MaqicXu
1bef6d085d 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
1291c38d58 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
3a883b9e41 refactor: cargo clippy 2024-01-10 17:36:35 +08:00
GyDi
bedd3abf8a refactor: done 2022-11-18 18:18:41 +08:00
GyDi
84c12dee80 refactor: wip 2022-11-17 17:07:13 +08:00
GyDi
d566629d51 refactor: fix 2022-11-14 01:45:58 +08:00
GyDi
837422fbb8 refactor: wip 2022-11-14 01:26:33 +08:00
GyDi
a45c61f19e chore: format rust code 2022-11-12 11:37:23 +08:00
GyDi
2d00ddad2b refactor: optimize 2022-09-11 20:58:55 +08:00
GyDi
7156871412 fix: reduce unsafe unwrap 2022-08-23 15:19:04 +08:00
FoundTheWOUT
20665a49ed fix: timer restore at app launch 2022-08-23 10:35:36 +08:00
GyDi
142a62e371 feat: refactor 2022-08-12 03:20:55 +08:00
GyDi
5be6f550be feat: improve log rule 2022-07-17 17:39:44 +08:00
GyDi
cb3b51dcde feat: add update interval 2022-04-21 14:26:41 +08:00
GyDi
9dd41be608 feat: supports cron update profiles 2022-04-20 20:37:16 +08:00
GyDi
401e6b5a57 refactor: wip 2022-04-19 01:41:20 +08:00