diff --git a/server/model/monitor.js b/server/model/monitor.js index 4bb859e9..d6e1896a 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -755,7 +755,7 @@ class Monitor extends BeanModel { await R.store(bean); log.debug("monitor", `[${this.name}] prometheus.update`); - this.prometheus.update(bean, tlsInfo); + this.prometheus?.update(bean, tlsInfo); previousBeat = bean; @@ -840,7 +840,7 @@ class Monitor extends BeanModel { clearTimeout(this.heartbeatInterval); this.isStop = true; - this.prometheus.remove(); + this.prometheus?.remove(); } /**