fix: tcp ping timeout latency

pull/5/head
lyc8503 2023-12-08 15:40:13 +08:00
parent 759a0f6159
commit dfd78b9ca4
1 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,9 @@ export async function getStatus(
status.err = ''
} catch (e: Error | any) {
console.log(`${monitor.name} errored with ${e.name}: ${e.message}`)
if (e.message.includes('timed out')) {
status.ping = monitor.timeout || 10000
}
status.up = false
status.err = e.name + ': ' + e.message
}