add monitor an dprevStatus to response from statusService if monitor status does not change

This commit is contained in:
Alex Holliday committed 2024-11-22 11:56:13 +08:00
1 parent b96648b155
commit 355f7e0511
1 file changed
+2 -1
+2 -1
View File
@@ -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({