From 0ac0f2e99a49077ddc00ac3ab78f9139a41a8604 Mon Sep 17 00:00:00 2001 From: lyc8503 Date: Fri, 20 Oct 2023 02:25:24 +0800 Subject: [PATCH] fix a stupid bug, please blame on vsc --- worker/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/src/index.ts b/worker/src/index.ts index 412d091..82f834b 100644 --- a/worker/src/index.ts +++ b/worker/src/index.ts @@ -118,7 +118,7 @@ export default { } ] // Then lastIncident here must not be undefined - const lastIncident = incidentList.slice(-1)[0] + const lastIncident = state.incident[monitor.id].slice(-1)[0] const timeString = new Date().toLocaleString(config.dateLocale, { timeZone: config.timezone }) if (status.up) { @@ -132,7 +132,7 @@ export default { // Current status is down // open new incident if not already open if (lastIncident.end !== undefined) { - incidentList.push({ + state.incident[monitor.id].push({ start: [currentTimeSecond], end: undefined, error: [status.err]