diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index cf4578d..a5dcf8a 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -342,11 +342,15 @@ async fn post_result( token: &str, result: PingResult, ) -> Result<()> { - client - .post(format!("{coordinator_url}/internal/ingest")) - .header("x-monitor-token", token) - .json(&result) - .send() - .await?; + tokio::time::timeout( + std::time::Duration::from_secs(10), + client + .post(format!("{coordinator_url}/internal/ingest")) + .header("x-monitor-token", token) + .json(&result) + .send() + ).await + .map_err(|_| anyhow::anyhow!("post_result timed out"))? + .map_err(|e| anyhow::anyhow!("{e}"))?; Ok(()) }