Merge pull request #2888 from fosrl/dev

Fix imports
This commit is contained in:
Owen Schwartz
2026-04-21 22:05:41 -07:00
committed by GitHub
6 changed files with 31 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ export async function fireHealthCheckHealthyAlert(
return; return;
} }
export async function fireHealthCheckNotHealthyAlert( export async function fireHealthCheckUnhealthyAlert(
orgId: string, orgId: string,
healthCheckId: number, healthCheckId: number,
healthCheckName?: string, healthCheckName?: string,

View File

@@ -0,0 +1,20 @@
export async function fireResourceHealthyAlert(
orgId: string,
resourceId: number,
resourceName?: string | null,
extra?: Record<string, unknown>
): Promise<void> {}
export async function fireResourceUnhealthyAlert(
orgId: string,
resourceId: number,
resourceName?: string | null,
extra?: Record<string, unknown>
): Promise<void> {}
export async function fireResourceToggleAlert(
orgId: string,
resourceId: number,
resourceName?: string | null,
extra?: Record<string, unknown>
): Promise<void> {}

View File

@@ -1,2 +1,3 @@
export * from "./events/siteEvents"; export * from "./events/siteEvents";
export * from "./events/healthCheckEvents"; export * from "./events/healthCheckEvents";
export * from "./events/resourceEvents";

View File

@@ -102,7 +102,7 @@ export async function fireHealthCheckUnhealthyAlert(
}); });
} catch (err) { } catch (err) {
logger.error( logger.error(
`fireHealthCheckNotHealthyAlert: unexpected error for healthCheckId ${healthCheckId}`, `fireHealthCheckUnhealthyAlert: unexpected error for healthCheckId ${healthCheckId}`,
err err
); );
} }

View File

@@ -17,3 +17,4 @@ export * from "./sendAlertWebhook";
export * from "./sendAlertEmail"; export * from "./sendAlertEmail";
export * from "./events/siteEvents"; export * from "./events/siteEvents";
export * from "./events/healthCheckEvents"; export * from "./events/healthCheckEvents";
export * from "./events/resourceEvents";

View File

@@ -14,7 +14,10 @@ import {
fireHealthCheckHealthyAlert, fireHealthCheckHealthyAlert,
fireHealthCheckUnhealthyAlert fireHealthCheckUnhealthyAlert
} from "#dynamic/lib/alerts"; } from "#dynamic/lib/alerts";
import { fireResourceHealthyAlert, fireResourceUnhealthyAlert } from "@server/private/lib/alerts/events/resourceEvents"; import {
fireResourceHealthyAlert,
fireResourceUnhealthyAlert
} from "#dynamic/lib/alerts";
interface TargetHealthStatus { interface TargetHealthStatus {
status: string; status: string;
@@ -223,13 +226,13 @@ export const handleHealthcheckStatusMessage: MessageHandler = async (
await fireHealthCheckUnhealthyAlert( await fireHealthCheckUnhealthyAlert(
orgId, orgId,
targetCheck.targetHealthCheckId, targetCheck.targetHealthCheckId,
targetCheck.name targetCheck.name ?? undefined
); );
} else if (healthStatus.status === "healthy") { } else if (healthStatus.status === "healthy") {
await fireHealthCheckHealthyAlert( await fireHealthCheckHealthyAlert(
orgId, orgId,
targetCheck.targetHealthCheckId, targetCheck.targetHealthCheckId,
targetCheck.name targetCheck.name ?? undefined
); );
} }