From 09d2dcd1dbc6d35b1b33e042bccd15c0ee71cd06 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sun, 15 Jun 2025 14:48:32 +0200 Subject: [PATCH] Fetch until ok --- etc/hotreload.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/hotreload.js b/etc/hotreload.js index c0b42bc..34b1dd7 100644 --- a/etc/hotreload.js +++ b/etc/hotreload.js @@ -1,8 +1,19 @@ let build_id = ""; +async function fetch_until_ok(uri) +{ + while (true) { + try { + return await fetch(uri); + } catch { + + } + } +} + async function fetch_build_id() { - const response = await fetch("/build-id"); + const response = await fetch_until_ok("/build-id"); const json = await response.json(); return json.build_id; }