refactor(all server stats): added a 5 second time out if it dose not reach it just stops

This commit is contained in:
2025-10-31 09:46:27 -05:00
parent a7a9aa2874
commit 2133b94a1d
2 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
vars { vars {
url: http://localhost:5500 url: https://usbet1prod.alpla.net
session_cookie: session_cookie:
urlv2: http://localhost:3000 urlv2: http://localhost:3000
jwtV2: jwtV2:

View File

@@ -66,7 +66,9 @@ router.get("/", async (req, res) => {
} else { } else {
url = `https://${sInfo[i].plantToken}prod.alpla.net/lst/api/system/stats`; url = `https://${sInfo[i].plantToken}prod.alpla.net/lst/api/system/stats`;
} }
const { data: prodServerInfo } = await axios.get(url); const { data: prodServerInfo } = await axios.get(url, {
timeout: 5 * 60 * 1000,
});
// console.log( // console.log(
// `${sInfo[i].plantToken}, data ${JSON.stringify(prodServerInfo)}`, // `${sInfo[i].plantToken}, data ${JSON.stringify(prodServerInfo)}`,