mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-23 05:01:54 +01:00
Add timeout.
This commit is contained in:
@@ -76,7 +76,7 @@ export default {
|
|||||||
|
|
||||||
async function fetchAlive(host: {host: string, name: string, alive: boolean, type: 'ping' | 'website'}) {
|
async function fetchAlive(host: {host: string, name: string, alive: boolean, type: 'ping' | 'website'}) {
|
||||||
if(host.type === 'ping'){
|
if(host.type === 'ping'){
|
||||||
let res = await ping.promise.probe(host.host, {timeout: 3});
|
let res = await ping.promise.probe(host.host, {timeout: 5});
|
||||||
host.alive = res.alive;
|
host.alive = res.alive;
|
||||||
}else if(host.type === 'website'){
|
}else if(host.type === 'website'){
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user