Rename variables and avoid merge conflict

This commit is contained in:
lucas_nz 2023-10-15 09:07:34 +13:00
parent 537ab442a5
commit 1598c2855c
2 changed files with 5 additions and 6 deletions

View file

@ -348,13 +348,13 @@ class Monitor extends BeanModel {
}
try {
let hostname = this.hostname;
let HostnameOrIp = this.hostname;
if (this.type === "ping" || this.type === "port" ) {
try {
hostname = await lookup(this.hostname, this.ipFamily);
HostnameOrIp = await lookup(this.hostname, this.ipFamily);
} catch (err) {
log.debug("monitor", err);
hostname = null;
HostnameOrIp = null;
}
}
@ -587,12 +587,12 @@ class Monitor extends BeanModel {
}
} else if (this.type === "port") {
bean.ping = await tcping(hostname, this.port);
bean.ping = await tcping(HostnameOrIp, this.port);
bean.msg = "";
bean.status = UP;
} else if (this.type === "ping") {
bean.ping = await ping(hostname, this.packetSize);
bean.ping = await ping(HostnameOrIp, this.packetSize);
bean.msg = "";
bean.status = UP;
} else if (this.type === "push") { // Type: Push

View file

@ -1559,7 +1559,6 @@ let needSetup = false;
dns_resolve_server: monitorListData[i].dns_resolve_server,
notificationIDList: monitorListData[i].notificationIDList,
proxy_id: monitorListData[i].proxy_id || null,
ipFamily: monitorListData[i].ipFamily,
};
if (monitorListData[i].pushToken) {