mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
refactor: restructure async initialization and standardize logging system
### Major Improvements - **Async initialization refactoring**: Complete async migration of init_config, improving app startup performance and stability - Change init_work_config from blocking to async execution - Optimize error handling for directory creation and config file initialization - Enhance structure and robustness of initialization process - **Logging system standardization**: Unify usage of project's built-in logging! macro - Replace all log::info!/warn!/error!/debug! with logging!(level, Type::Setup, true, ...) format - Maintain consistency in log categorization and formatting - Improve convenience for log tracking and debugging ### Technical Optimizations - **Error handling improvements**: Remove crate::log_err! macro, use standard Result error propagation - **Directory management optimization**: Refactor ensure_directories function with clearer directory creation logic - **Config initialization enhancement**: Separate initialize_config_files function for better code maintainability - **Async task management**: Use AsyncHandler::spawn to optimize background log cleanup tasks ### Bug Fixes - Fix potential race conditions in async config initialization - Improve error feedback and logging during app startup - Enhance error handling for DNS config and resource file initialization ### Updates - Update wording in UPDATELOG.md issue descriptions
This commit is contained in:
@@ -33,9 +33,10 @@ pub fn resolve_setup_async() {
|
||||
std::thread::current().id()
|
||||
);
|
||||
|
||||
AsyncHandler::spawn_blocking(|| AsyncHandler::block_on(init_work_config()));
|
||||
// AsyncHandler::spawn_blocking(|| AsyncHandler::block_on(init_work_config()));
|
||||
|
||||
AsyncHandler::spawn(|| async {
|
||||
init_work_config().await;
|
||||
init_resources().await;
|
||||
init_startup_script().await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user