mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-29 20:22:59 +00:00
Making the alerts work
This commit is contained in:
@@ -23,7 +23,7 @@ import { fromError } from "zod-validation-error";
|
||||
import { eq, and } from "drizzle-orm";
|
||||
import {
|
||||
fireHealthCheckHealthyAlert,
|
||||
fireHealthCheckNotHealthyAlert
|
||||
fireHealthCheckUnhealthyAlert
|
||||
} from "#private/lib/alerts/events/healthCheckEvents";
|
||||
|
||||
const paramsSchema = z.strictObject({
|
||||
@@ -106,7 +106,7 @@ export async function triggerHealthCheckAlert(
|
||||
healthCheck.name ?? undefined
|
||||
);
|
||||
} else {
|
||||
await fireHealthCheckNotHealthyAlert(
|
||||
await fireHealthCheckUnhealthyAlert(
|
||||
orgId,
|
||||
healthCheckId,
|
||||
healthCheck.name ?? undefined
|
||||
@@ -126,4 +126,4 @@ export async function triggerHealthCheckAlert(
|
||||
createHttpError(HttpCode.INTERNAL_SERVER_ERROR, "An error occurred")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ const bodySchema = z
|
||||
...RESOURCE_EVENT_TYPES
|
||||
]),
|
||||
enabled: z.boolean().optional().default(true),
|
||||
cooldownSeconds: z.number().int().nonnegative().optional().default(300),
|
||||
cooldownSeconds: z.number().int().nonnegative().optional().default(0),
|
||||
// Source join tables - which is required depends on eventType
|
||||
siteIds: z.array(z.number().int().positive()).optional().default([]),
|
||||
allSites: z.boolean().optional().default(false),
|
||||
|
||||
@@ -39,7 +39,7 @@ const bodySchema = z.strictObject({
|
||||
hcMethod: z.string().default("GET"),
|
||||
hcInterval: z.number().int().positive().default(30),
|
||||
hcUnhealthyInterval: z.number().int().positive().default(30),
|
||||
hcTimeout: z.number().int().positive().default(5),
|
||||
hcTimeout: z.number().int().positive().default(1),
|
||||
hcHeaders: z.string().optional().nullable(),
|
||||
hcFollowRedirects: z.boolean().default(true),
|
||||
hcStatus: z.number().int().optional().nullable(),
|
||||
|
||||
Reference in New Issue
Block a user