Fetch until ok

This commit is contained in:
kamkow1
2025-06-15 14:48:32 +02:00
parent 3d09d1dd67
commit 09d2dcd1db

View File

@ -1,8 +1,19 @@
let build_id = ""; let build_id = "";
async function fetch_until_ok(uri)
{
while (true) {
try {
return await fetch(uri);
} catch {
}
}
}
async function fetch_build_id() async function fetch_build_id()
{ {
const response = await fetch("/build-id"); const response = await fetch_until_ok("/build-id");
const json = await response.json(); const json = await response.json();
return json.build_id; return json.build_id;
} }