tangled
alpha
login
or
join now
openstatus.dev
/
openstatus
6
fork
atom
Openstatus
www.openstatus.dev
6
fork
atom
overview
issues
pulls
pipelines
fix: incident null
mxkaske
2 years ago
5fde5a0a
fb867639
+4
-3
1 changed file
expand all
collapse all
unified
split
apps
server
src
checker
index.ts
+4
-3
apps/server/src/checker/index.ts
···
1
1
import { Hono } from "hono";
2
2
import { z } from "zod";
3
3
4
4
-
import { and, db, eq, isNotNull, schema } from "@openstatus/db";
4
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
55
-
isNotNull(incidentTable.resolvedAt),
56
56
-
isNotNull(incidentTable.acknowledgedAt),
55
55
+
isNull(incidentTable.resolvedAt),
56
56
+
isNull(incidentTable.acknowledgedAt),
57
57
),
58
58
)
59
59
.get();
60
60
+
60
61
// if we are in error
61
62
if (!statusCode || (statusCode < 200 && statusCode > 300)) {
62
63
// create incident