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

@@ -66,7 +66,9 @@ router.get("/", async (req, res) => {
} else {
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(
// `${sInfo[i].plantToken}, data ${JSON.stringify(prodServerInfo)}`,