From 9aa51d65fd3360ee39e295258f6c55f8a7273a0d Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Wed, 4 Sep 2024 11:25:26 -0500 Subject: [PATCH] add a catch to a fetch for better server stablity --- stats.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats.js b/stats.js index ddf52f7..917cd18 100644 --- a/stats.js +++ b/stats.js @@ -42,6 +42,11 @@ async function observe(instances){ function check(){ fetch(api+"ping",{method: "HEAD"}).then(_=>{ setStatus(instance,_.ok); + }).catch(_=>{ + console.log("Ping errored"); + setTimeout(1000*60,_=>{ + check(); + }) }); } setTimeout(