fix(web): use /global/health for readiness check
This commit is contained in:
@@ -1959,13 +1959,19 @@ async function waitForReady(url, timeoutMs = 10000) {
|
|||||||
try {
|
try {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), 3000);
|
const timeout = setTimeout(() => controller.abort(), 3000);
|
||||||
const res = await fetch(`${url.replace(/\/+$/, '')}/config`, {
|
const res = await fetch(`${url.replace(/\/+$/, '')}/global/health`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { Accept: 'application/json' },
|
headers: { Accept: 'application/json' },
|
||||||
signal: controller.signal
|
signal: controller.signal
|
||||||
});
|
});
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
if (res.ok) return true;
|
|
||||||
|
if (res.ok) {
|
||||||
|
const body = await res.json().catch(() => null);
|
||||||
|
if (body?.healthy === true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user