Domain Name Expiry Notification for https monitor only

This commit is contained in:
Louis Lam
2022-04-16 15:01:53 +08:00
parent 30e113755e
commit 566133e350
2 changed files with 4 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
log.debug("mqtt", "MQTT timeout triggered");
client.end();
reject("Timeout");
}, interval * 1000);
}, interval * 1000 * 0.8);
log.debug("mqtt", "MQTT connecting");
@@ -121,6 +121,8 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
try {
client.subscribe(topic);
} catch (e) {
client.end();
clearTimeout(timeoutID);
reject(new Error("Cannot subscribe topic"));
}
});