Skip to content

Commit 289e824

Browse files
Fix monitor reference in push notification logic (#5842)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
1 parent 0b29fd4 commit 289e824

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/routers/api-router.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ router.all("/api/push/:pushToken", async (request, response) => {
9898
// Reset down count
9999
bean.downCount = 0;
100100

101-
log.debug("monitor", `[${this.name}] sendNotification`);
101+
log.debug("monitor", `[${monitor.name}] sendNotification`);
102102
await Monitor.sendNotification(isFirstBeat, monitor, bean);
103103
} else {
104-
if (bean.status === DOWN && this.resendInterval > 0) {
104+
if (bean.status === DOWN && monitor.resendInterval > 0) {
105105
++bean.downCount;
106-
if (bean.downCount >= this.resendInterval) {
106+
if (bean.downCount >= monitor.resendInterval) {
107107
// Send notification again, because we are still DOWN
108-
log.debug("monitor", `[${this.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
109-
await Monitor.sendNotification(isFirstBeat, this, bean);
108+
log.debug("monitor", `[${monitor.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${monitor.resendInterval}`);
109+
await Monitor.sendNotification(isFirstBeat, monitor, bean);
110110

111111
// Reset down count
112112
bean.downCount = 0;

0 commit comments

Comments
 (0)