From 786db6dadaa14a5e49074d7fead869af674c19ae Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Wed, 6 Oct 2021 20:23:25 +0200 Subject: [PATCH] fix(monitor): if monitor checks fail do not set a ping --- server/model/monitor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index b6cf0a9..3ac1168 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -153,8 +153,6 @@ class Monitor extends BeanModel { maxRedirects: this.maxredirects, validateStatus: undefined, }); - bean.msg = `${res.status} - ${res.statusText}`; - bean.ping = dayjs().valueOf() - startTime; // Check certificate if https is used let certInfoStartTime = dayjs().valueOf(); @@ -170,7 +168,11 @@ class Monitor extends BeanModel { debug("Cert Info Query Time: " + (dayjs().valueOf() - certInfoStartTime) + "ms"); + bean.msg = `${res.status} - ${res.statusText}`; + validateMonitorChecks(res, await this.getMonitorChecks(), bean); + + bean.ping = dayjs().valueOf() - startTime; } else if (this.type === "port") { bean.ping = await tcping(this.hostname, this.port); bean.msg = "";