diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index c71b505..bac76ad 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -66,6 +66,10 @@ async fn run_check(client: &reqwest::Client, monitor: &Monitor, scheduled_at: Op let start = Instant::now(); + // Build request with method, headers, body, timeout + let method = monitor.method.as_deref().unwrap_or("GET").to_uppercase(); + let timeout = std::time::Duration::from_millis(monitor.timeout_ms.unwrap_or(30000)); + // Check cert expiry for HTTPS URLs — bounded by the same timeout let cert_expiry_days = if monitor.url.starts_with("https://") { match tokio::time::timeout(timeout, check_cert_expiry(&monitor.url)).await { @@ -76,10 +80,6 @@ async fn run_check(client: &reqwest::Client, monitor: &Monitor, scheduled_at: Op None }; - // Build request with method, headers, body, timeout - let method = monitor.method.as_deref().unwrap_or("GET").to_uppercase(); - let timeout = std::time::Duration::from_millis(monitor.timeout_ms.unwrap_or(30000)); - let req_method = reqwest::Method::from_bytes(method.as_bytes()) .unwrap_or(reqwest::Method::GET);