From 355f7e0511ec04150130fe2eb392f2c722eac1a6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 22 Nov 2024 11:56:13 +0800 Subject: [PATCH] add monitor an dprevStatus to response from statusService if monitor status does not change --- Server/service/statusService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/service/statusService.js b/Server/service/statusService.js index 4f7c1a4ce..6e61ea232 100644 --- a/Server/service/statusService.js +++ b/Server/service/statusService.js @@ -29,7 +29,8 @@ class StatusService { const { monitorId, status } = networkResponse; const monitor = await this.db.getMonitorById(monitorId); // No change in monitor status, return early - if (monitor.status === status) return { statusChanged: false }; + if (monitor.status === status) + return { monitor, statusChanged: false, prevStatus: monitor.status }; // Monitor status changed, save prev status and update monitor this.logger.info({