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

View file

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