From dcf2854a16f949d769585aca6906254c044f4ee6 Mon Sep 17 00:00:00 2001 From: Chris Christiansen Date: Wed, 24 Jun 2026 15:02:54 +0000 Subject: [PATCH] fix: add timeout to startup fetch calls --- static/opax.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/opax.html b/static/opax.html index 7fa32b4..6e06b51 100644 --- a/static/opax.html +++ b/static/opax.html @@ -781,7 +781,7 @@ function docsBrowserSelect(path){ // BUILD STATUS POLL async function pollBuild(){ try{ - const d = await fetch('/opax/build-status').then(r=>r.json()) + const d = await fetchWithTimeout('/opax/build-status', 5000).then(r=>r.ok ? r.json() : null) const builds = d.builds || [] const latest = builds[0] || {} const st = (latest.status || d.status || '').toUpperCase() @@ -797,7 +797,7 @@ async function pollBuild(){ document.addEventListener('DOMContentLoaded', async () => { // Sjekk auth-status try { - const r = await fetch('/auth/me') + const r = await fetchWithTimeout('/auth/me', 5000) if(r.ok){ const u = await r.json() document.getElementById('sb-session').textContent = u.email || 'innlogget'