diff --git a/static/index.html b/static/index.html index dfd7e98..41765a8 100644 --- a/static/index.html +++ b/static/index.html @@ -53,7 +53,7 @@ } protobuf.load("/schema.proto").then((root) => { - setInterval(async () => { + async function reload() { const bin = await fetch("/api").then((r) => r.arrayBuffer()); const { vehicles } = root .lookupType("VehicleFeed") @@ -75,7 +75,11 @@ ) ); }); - }, 5000); + } + + reload(); + + setInterval(reload, 5000); });