Browse Source

fix(monitor): if monitor checks fail do not set a ping

bertyhell/feature/monitor-checks
Bert Verhelst 3 years ago
parent
commit
786db6dada
  1. 6
      server/model/monitor.js

6
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 = "";

Loading…
Cancel
Save