Openstatus www.openstatus.dev

fix: incident null

mxkaske 5fde5a0a fb867639

+4 -3
+4 -3
apps/server/src/checker/index.ts
··· 1 1 import { Hono } from "hono"; 2 2 import { z } from "zod"; 3 3 4 - import { and, db, eq, isNotNull, schema } from "@openstatus/db"; 4 + import { and, db, eq, isNull, schema } from "@openstatus/db"; 5 5 import { incidentTable } from "@openstatus/db/src/schema"; 6 6 import { flyRegions } from "@openstatus/db/src/schema/monitors/constants"; 7 7 import { selectMonitorSchema } from "@openstatus/db/src/schema/monitors/validation"; ··· 52 52 .where( 53 53 and( 54 54 eq(incidentTable.monitorId, Number(monitorId)), 55 - isNotNull(incidentTable.resolvedAt), 56 - isNotNull(incidentTable.acknowledgedAt), 55 + isNull(incidentTable.resolvedAt), 56 + isNull(incidentTable.acknowledgedAt), 57 57 ), 58 58 ) 59 59 .get(); 60 + 60 61 // if we are in error 61 62 if (!statusCode || (statusCode < 200 && statusCode > 300)) { 62 63 // create incident