mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 15:06:59 +08:00
added connection timeout and refactored code
This commit is contained in:
@@ -321,7 +321,12 @@ class Monitor extends BeanModel {
|
||||
}
|
||||
} else if (this.type === "mqtt") {
|
||||
try {
|
||||
bean.msg = await mqttAsync(this.url, this.mqttPort, this.mqttUsername, this.mqttPassword, this.mqttTopic, this.mqttSuccessMessage);
|
||||
bean.msg = await mqttAsync(this.url, this.mqttTopic, this.mqttSuccessMessage, {
|
||||
mqttPort: this.mqttPort,
|
||||
mqttUsername: this.mqttUsername,
|
||||
mqttPassword: this.mqttPassword,
|
||||
interval: this.interval,
|
||||
});
|
||||
bean.status = UP;
|
||||
} catch (error) {
|
||||
bean.status = DOWN;
|
||||
|
Reference in New Issue
Block a user