refactor: simplify proxy type handling and improve error handling in network commands

This commit is contained in:
Tunglies
2025-05-16 00:09:34 +08:00
parent 92ae277e3a
commit 53a46d0dc6
11 changed files with 30 additions and 35 deletions

View File

@@ -385,10 +385,7 @@ impl Timer {
}
};
let profile = match items
.iter()
.find(|item| item.uid.as_ref().map(|u| u.as_str()) == Some(uid))
{
let profile = match items.iter().find(|item| item.uid.as_deref() == Some(uid)) {
Some(p) => p,
None => {
logging!(warn, Type::Timer, "找不到对应的配置uid={}", uid);
@@ -441,7 +438,6 @@ impl Timer {
}
/// Async task with better error handling and logging
async fn async_task(uid: String) {
let task_start = std::time::Instant::now();
logging!(info, Type::Timer, "Running timer task for profile: {}", uid);