fix: apply timeout to cert check — was hanging indefinitely before request even started
This commit is contained in:
parent
05c60db605
commit
81ac8f0c20
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue