fix: apply timeout to cert check — was hanging indefinitely before request even started

This commit is contained in:
M1 2026-03-18 12:26:27 +04:00
parent 05c60db605
commit 81ac8f0c20
1 changed files with 5 additions and 2 deletions

View File

@ -66,9 +66,12 @@ async fn run_check(client: &reqwest::Client, monitor: &Monitor, scheduled_at: Op
let start = Instant::now();
// Check cert expiry for HTTPS URLs
// Check cert expiry for HTTPS URLs — bounded by the same timeout
let cert_expiry_days = if monitor.url.starts_with("https://") {
check_cert_expiry(&monitor.url).await.ok().flatten()
match tokio::time::timeout(timeout, check_cert_expiry(&monitor.url)).await {
Ok(Ok(days)) => days,
_ => None,
}
} else {
None
};