diff --git a/server/util-server.js b/server/util-server.js index 074867f7f..7a14a23de 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -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")); } }); diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 6dc48e07b..c118f53c1 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -172,7 +172,7 @@

{{ $t("Advanced") }}

-
+