Merge branch 'master' into master

This commit is contained in:
Frank Elsinga 2025-05-18 00:17:05 +02:00 committed by GitHub
commit c147b81a8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -736,7 +736,7 @@ class Database {
if (Database.dbConfig.type === "sqlite") { if (Database.dbConfig.type === "sqlite") {
return "DATETIME('now', ? || ' hours')"; return "DATETIME('now', ? || ' hours')";
} else { } else {
return "DATE_ADD(NOW(), INTERVAL ? HOUR)"; return "DATE_ADD(UTC_TIMESTAMP(), INTERVAL ? HOUR)";
} }
} }

View file

@ -98,15 +98,15 @@ router.all("/api/push/:pushToken", async (request, response) => {
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;
log.debug("monitor", `[${this.name}] sendNotification`); log.debug("monitor", `[${monitor.name}] sendNotification`);
await Monitor.sendNotification(isFirstBeat, monitor, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
} else { } else {
if (bean.status === DOWN && this.resendInterval > 0) { if (bean.status === DOWN && monitor.resendInterval > 0) {
++bean.downCount; ++bean.downCount;
if (bean.downCount >= this.resendInterval) { if (bean.downCount >= monitor.resendInterval) {
// Send notification again, because we are still DOWN // Send notification again, because we are still DOWN
log.debug("monitor", `[${this.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`); log.debug("monitor", `[${monitor.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${monitor.resendInterval}`);
await Monitor.sendNotification(isFirstBeat, this, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;