add a catch to a fetch for better server stablity
This commit is contained in:
5
stats.js
5
stats.js
@@ -42,6 +42,11 @@ async function observe(instances){
|
|||||||
function check(){
|
function check(){
|
||||||
fetch(api+"ping",{method: "HEAD"}).then(_=>{
|
fetch(api+"ping",{method: "HEAD"}).then(_=>{
|
||||||
setStatus(instance,_.ok);
|
setStatus(instance,_.ok);
|
||||||
|
}).catch(_=>{
|
||||||
|
console.log("Ping errored");
|
||||||
|
setTimeout(1000*60,_=>{
|
||||||
|
check();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setTimeout(
|
setTimeout(
|
||||||
|
Reference in New Issue
Block a user