From 74985276674b1a9b2a44164547376a2e84a00771 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Mon, 16 Feb 2026 11:54:00 +0000 Subject: [PATCH] Increase ML backend stats timeout and add detailed error logging Extend timeout for fetching ML backend stats from 5 to 15 seconds and add detailed error logging to the /api/ml/stats endpoint to diagnose potential issues. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 67dbf601-ef19-4ba2-8e69-77f75ec2c104 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/MmMtYN7 --- server/routes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/routes.ts b/server/routes.ts index ec09efa..d39d80f 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -719,7 +719,7 @@ export async function registerRoutes(app: Express): Promise { app.get("/api/ml/stats", async (req, res) => { try { const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), 5000); + const timeout = setTimeout(() => controller.abort(), 15000); const response = await fetch(`${ML_BACKEND_URL}/stats`, { headers: getMLBackendHeaders(), @@ -735,6 +735,7 @@ export async function registerRoutes(app: Express): Promise { const data = await response.json(); res.json(data); } catch (error: any) { + console.warn(`[ML Stats] Fallback to database - ML Backend error: ${error.message || error.code || 'unknown'}`); try { const latestTraining = await db .select()