diff --git a/server/database.js b/server/database.js index 3fa5bf7..cd7645d 100644 --- a/server/database.js +++ b/server/database.js @@ -110,6 +110,7 @@ class Database { await R.autoloadModels("./server/model"); R.modelList["monitor_checks"] = MonitorCheck; + await R.exec("PRAGMA foreign_keys = ON"); // Change to WAL await R.exec("PRAGMA journal_mode = WAL"); await R.exec("PRAGMA cache_size = -12000"); diff --git a/server/model/monitor.js b/server/model/monitor.js index 66ff390..e462934 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -313,7 +313,7 @@ class Monitor extends BeanModel { if (bean.status === UP) { console.info(`Monitor #${this.id} '${this.name}': Successful Response: ${bean.ping} ms | Interval: ${beatInterval} seconds | Type: ${this.type}`); } else if (bean.status === PENDING) { - if (this.retryInterval !== this.interval) { + if (this.retryInterval > 0) { beatInterval = this.retryInterval; } console.warn(`Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Max retries: ${this.maxretries} | Retry: ${retries} | Retry Interval: ${beatInterval} seconds | Type: ${this.type}`); diff --git a/server/server.js b/server/server.js index e0f49c4..dcd9859 100644 --- a/server/server.js +++ b/server/server.js @@ -679,6 +679,8 @@ exports.entryPage = "dashboard"; }); await sendMonitorList(socket); + // Clear heartbeat list on client + await sendImportantHeartbeatList(socket, monitorID, true, true); } catch (e) { callback({