diff --git a/src/views/AdminView.vue b/src/views/AdminView.vue index d1fce4a..e4a3268 100644 --- a/src/views/AdminView.vue +++ b/src/views/AdminView.vue @@ -761,13 +761,22 @@ async function startService(name: string) { const started = typeof result === 'string' ? result === 'started' : result?.result === 'started' s.result.value = started ? (name === 'mbe' ? 'Loading model...' : 'Service started') : JSON.stringify(result) s.ok.value = started - // Poll up to 30s for the service to pass health check - for (let i = 0; i < 15; i++) { - await new Promise(r => setTimeout(r, 2000)) + // For MBE, backend already polls for 60s, just test once + if (name !== 'mbe') { + // Poll up to 30s for the service to pass health check + for (let i = 0; i < 15; i++) { + await new Promise(r => setTimeout(r, 2000)) + await s.test() + if (s.status.value === 'online') { + s.result.value = 'Service started' + break + } + } + } else { + // MBE: test once after backend returns await s.test() if (s.status.value === 'online') { s.result.value = 'Service started' - break } } } catch (e: any) {