cleanup: remove debug warn logs from monitor runner

This commit is contained in:
M1 2026-03-18 13:30:19 +04:00
parent 6e1d642c77
commit 6b8e1fc9d9
1 changed files with 3 additions and 8 deletions

View File

@ -63,10 +63,8 @@ pub async fn fetch_and_run(
}; };
// Remove from in-flight before posting so a fast next cycle can pick it up // Remove from in-flight before posting so a fast next cycle can pick it up
in_flight.lock().await.remove(&monitor.id); in_flight.lock().await.remove(&monitor.id);
warn!("posting result for {} up={}", monitor.id, result.up); if let Err(e) = post_result(&client, &coordinator_url, &token, result).await {
match post_result(&client, &coordinator_url, &token, result).await { warn!("Failed to post result for {}: {e}", monitor.id);
Ok(_) => warn!("posted result for {}", monitor.id),
Err(e) => warn!("Failed to post result for {}: {e}", monitor.id),
} }
}); });
} }
@ -107,7 +105,7 @@ async fn run_check(client: &reqwest::Client, monitor: &Monitor, scheduled_at: Op
match result { match result {
Err(ref e) => { Err(ref e) => {
warn!("{} check error: {e}", monitor.url); debug!("{} check error: {e}", monitor.url);
PingResult { PingResult {
monitor_id: monitor.id.clone(), monitor_id: monitor.id.clone(),
scheduled_at, scheduled_at,
@ -230,16 +228,13 @@ async fn run_curl(
let tmp_owned = tmp.clone(); let tmp_owned = tmp.clone();
let (tx, rx) = tokio::sync::oneshot::channel::<(std::io::Result<std::process::ExitStatus>, Vec<u8>)>(); let (tx, rx) = tokio::sync::oneshot::channel::<(std::io::Result<std::process::ExitStatus>, Vec<u8>)>();
let url_log = url.to_string();
std::thread::spawn(move || { std::thread::spawn(move || {
tracing::warn!("curl thread starting for {url_log}");
let status = std::process::Command::new("curl") let status = std::process::Command::new("curl")
.args(&args_owned) .args(&args_owned)
.stdin(Stdio::null()) .stdin(Stdio::null())
.stdout(Stdio::null()) .stdout(Stdio::null())
.stderr(Stdio::null()) .stderr(Stdio::null())
.status(); .status();
tracing::warn!("curl thread done for {url_log}: {:?}", status);
let output = std::fs::read(&tmp_owned).unwrap_or_default(); let output = std::fs::read(&tmp_owned).unwrap_or_default();
let _ = std::fs::remove_file(&tmp_owned); let _ = std::fs::remove_file(&tmp_owned);
let _ = tx.send((status, output)); let _ = tx.send((status, output));