fix: add timeout to startup fetch calls
This commit is contained in:
parent
c27a783388
commit
dcf2854a16
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user