mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 07:14:04 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6335b72c2b
1 changed files with 8 additions and 2 deletions
|
@ -87,8 +87,14 @@ exports.ping = async (hostname, size = 56) => {
|
||||||
return await exports.pingAsync(hostname, false, size);
|
return await exports.pingAsync(hostname, false, size);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the host cannot be resolved, try again with ipv6
|
// If the host cannot be resolved, try again with ipv6
|
||||||
// As node-ping does not report a specific error for this, try again with ipv6 no matter what.
|
console.debug("ping", "IPv6 error message: " + e.message);
|
||||||
return await exports.pingAsync(hostname, true, size);
|
|
||||||
|
// As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what.
|
||||||
|
if (!e.message) {
|
||||||
|
return await exports.pingAsync(hostname, true, size);
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue