Fix prometheus null issues

This commit is contained in:
Louis Lam 2023-02-24 17:12:57 +08:00
parent e9475ed3c0
commit 2fa233ae7f

View file

@ -755,7 +755,7 @@ class Monitor extends BeanModel {
await R.store(bean); await R.store(bean);
log.debug("monitor", `[${this.name}] prometheus.update`); log.debug("monitor", `[${this.name}] prometheus.update`);
this.prometheus.update(bean, tlsInfo); this.prometheus?.update(bean, tlsInfo);
previousBeat = bean; previousBeat = bean;
@ -840,7 +840,7 @@ class Monitor extends BeanModel {
clearTimeout(this.heartbeatInterval); clearTimeout(this.heartbeatInterval);
this.isStop = true; this.isStop = true;
this.prometheus.remove(); this.prometheus?.remove();
} }
/** /**