From 7f46223d684aa7d68a5d9270dd0e5f32d095e762 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 28 May 2022 23:22:44 +0800 Subject: [PATCH] Fix another log.debug call --- server/model/monitor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 0d2e8e2eb..ee7b4f43b 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -374,7 +374,9 @@ class Monitor extends BeanModel { // beatInterval/retryInterval in the setTimeout further below if (previousBeat) { const msSinceLastBeat = dayjs.utc().valueOf() - dayjs.utc(previousBeat.time).valueOf(); - log.debug(`[${this.name}] msSinceLastBeat = ${msSinceLastBeat}`); + + log.debug("monitor", `[${this.name}] msSinceLastBeat = ${msSinceLastBeat}`); + if (previousBeat.status !== UP || msSinceLastBeat > beatInterval * 1000 + bufferTime) { throw new Error("No heartbeat in the time window"); } else {