This commit is contained in:
monosans
2025-08-08 09:54:24 +03:00
parent b3b586ae25
commit 2dd54f7635
4 changed files with 12 additions and 20 deletions
+4 -12
View File
@@ -46,22 +46,14 @@ pub async fn check_all(
};
let check_result = proxy.check(&config).await;
#[cfg(feature = "tui")]
drop(tx.send(Event::App(AppEvent::ProxyChecked(
proxy.protocol,
))));
drop(tx.send(Event::App(AppEvent::ProxyChecked(proxy.protocol))));
match check_result {
Ok(()) => {
#[cfg(feature = "tui")]
drop(tx.send(Event::App(AppEvent::ProxyWorking(
proxy.protocol,
))));
drop(tx.send(Event::App(AppEvent::ProxyWorking(proxy.protocol))));
checked_proxies.lock().push(proxy);
}
Err(e)
if tracing::event_enabled!(
tracing::Level::DEBUG
) =>
{
Err(e) if tracing::event_enabled!(tracing::Level::DEBUG) => {
tracing::debug!(
"{} | {}",
proxy.as_str(true),
@@ -72,7 +64,7 @@ pub async fn check_all(
}
}
} => res,
() = token.cancelled() => ()
() = token.cancelled() => (),
}
});
}
+4 -4
View File
@@ -119,7 +119,7 @@ async fn download_output_dependencies(
#[cfg(feature = "tui")]
tx,
) => res,
() = token.cancelled() => Ok(())
() = token.cancelled() => Ok(()),
}
});
}
@@ -133,7 +133,7 @@ async fn download_output_dependencies(
#[cfg(feature = "tui")]
tx,
) => res,
() = token.cancelled() => Ok(())
() = token.cancelled() => Ok(()),
}
});
}
@@ -236,13 +236,13 @@ fn watch_signals(
tokio::spawn(async move {
tokio::select! {
biased;
() = token.cancelled() => {}
() = token.cancelled() => {},
_ = stream.recv() => {
tracing::info!("Received {} signal, exiting...", signal_name);
token.cancel();
#[cfg(feature = "tui")]
drop(tx.send(event::Event::App(event::AppEvent::Quit)));
}
},
}
});
}
+1 -1
View File
@@ -147,7 +147,7 @@ pub async fn scrape_all(
#[cfg(feature = "tui")]
tx,
) => res,
() = token.cancelled() => Ok(())
() = token.cancelled() => Ok(()),
}
});
}
+3 -3
View File
@@ -104,11 +104,11 @@ async fn tick_event_listener(tx: tokio::sync::mpsc::UnboundedSender<Event>) {
() = tx.closed() => {
break;
},
_ = tick.tick() =>{
_ = tick.tick() => {
if tx.send(Event::Tick).is_err() {
break;
}
}
},
}
}
}
@@ -135,7 +135,7 @@ async fn crossterm_event_listener(
break;
}
}
}
},
}
}
}