From 81ac8f0c20686387663d37f5b1ebe20b38e0d451 Mon Sep 17 00:00:00 2001 From: M1 Date: Wed, 18 Mar 2026 12:26:27 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20apply=20timeout=20to=20cert=20check=20?= =?UTF-8?q?=E2=80=94=20was=20hanging=20indefinitely=20before=20request=20e?= =?UTF-8?q?ven=20started?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/monitor/src/runner.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index 8319cc8..c71b505 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -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 };