From 143433054542687f8cc8565a088ff8815d55c9ac Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 8 Apr 2026 14:42:08 +0400 Subject: [PATCH] fix --- apps/monitor/src/runner.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/monitor/src/runner.rs b/apps/monitor/src/runner.rs index 1da8317..dd415de 100644 --- a/apps/monitor/src/runner.rs +++ b/apps/monitor/src/runner.rs @@ -26,13 +26,20 @@ pub async fn fetch_and_run( in_flight: &Arc>>, ) -> Result { let url = format!("{coordinator_url}/internal/due?region={region}&lookahead_ms=2000"); - let monitors: Vec = client + let resp = client .get(&url) .header("x-monitor-token", token) .send() - .await? - .json() .await?; + let status = resp.status(); + let body = resp.text().await?; + let monitors: Vec = match serde_json::from_str(&body) { + Ok(m) => m, + Err(e) => { + let preview: String = body.chars().take(500).collect(); + anyhow::bail!("/internal/due returned status {status}, body could not be parsed: {e}. Body preview: {preview}"); + } + }; let n = monitors.len(); if n == 0 { return Ok(0); }