Skip to content

Commit 8902b2c

Browse files
SUPERCILEXjakobhellermann
authored andcommitted
Keep trying to contact server forever
Inconsistency is faaar worse then the teeny bit of performance this saves. I can never know if I'll need to refresh a page or let it do its thing, so just always do the thing.
1 parent 57d5bd4 commit 8902b2c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

static/index.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@
3030
}
3131

3232
const reloadInterval = 1000;
33-
const maxFailCount = 20;
3433

3534
async function startReloadInterval() {
3635
const fetchVersion = () => fetch("/api/version").then(response => response.text());
3736
const version = await fetchVersion();
38-
let failedCount = 0;
3937
let intervalToken;
4038

4139
function reloadIfChanged() {
@@ -44,13 +42,6 @@
4442
if (version != newVersion) {
4543
window.location.reload();
4644
}
47-
})
48-
.catch(e => {
49-
failedCount += 1;
50-
if (failedCount >= maxFailCount) {
51-
clearInterval(intervalToken);
52-
console.warn("Server disconnected");
53-
}
5445
});
5546
}
5647

@@ -69,4 +60,4 @@
6960
</script>
7061
</body>
7162

72-
</html>
63+
</html>

0 commit comments

Comments
 (0)