From c690d1c3a13637afe2b320536702b4b93e15b1c7 Mon Sep 17 00:00:00 2001 From: Aram Akhavan Date: Mon, 13 Jun 2022 22:05:58 -0700 Subject: [PATCH] fix timeout bypass for upside down push monitor --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index eb8f69009..7c269fe26 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -406,7 +406,7 @@ class Monitor extends BeanModel { // If the previous beat was down or pending we use the regular // beatInterval/retryInterval in the setTimeout further below - if (previousBeat.status !== UP || msSinceLastBeat > beatInterval * 1000 + bufferTime) { + if (previousBeat.status !== (this.isUpsideDown() ? DOWN : UP) || msSinceLastBeat > beatInterval * 1000 + bufferTime) { throw new Error("No heartbeat in the time window"); } else { let timeout = beatInterval * 1000 - msSinceLastBeat;