mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-27 11:12:55 +00:00
Add new intervals and tcp mode to health checks
This commit is contained in:
@@ -158,7 +158,9 @@ export async function updateProxyResources(
|
||||
healthcheckData?.["follow-redirects"],
|
||||
hcMethod: healthcheckData?.method,
|
||||
hcStatus: healthcheckData?.status,
|
||||
hcHealth: "unknown"
|
||||
hcHealth: "unknown",
|
||||
hcHealthyThreshold: healthcheckData?.["healthy-threshold"],
|
||||
hcUnhealthyThreshold: healthcheckData?.["unhealthy-threshold"]
|
||||
})
|
||||
.returning();
|
||||
|
||||
@@ -522,7 +524,9 @@ export async function updateProxyResources(
|
||||
healthcheckData?.followRedirects ||
|
||||
healthcheckData?.["follow-redirects"],
|
||||
hcMethod: healthcheckData?.method,
|
||||
hcStatus: healthcheckData?.status
|
||||
hcStatus: healthcheckData?.status,
|
||||
hcHealthyThreshold: healthcheckData?.["healthy-threshold"],
|
||||
hcUnhealthyThreshold: healthcheckData?.["unhealthy-threshold"]
|
||||
})
|
||||
.where(
|
||||
eq(
|
||||
@@ -1081,6 +1085,8 @@ function checkIfHealthcheckChanged(
|
||||
JSON.stringify(incoming.hcHeaders)
|
||||
)
|
||||
return true;
|
||||
if (existing.hcHealthyThreshold !== incoming.hcHealthyThreshold) return true;
|
||||
if (existing.hcUnhealthyThreshold !== incoming.hcUnhealthyThreshold) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export const TargetHealthCheckSchema = z.object({
|
||||
hostname: z.string(),
|
||||
port: z.int().min(1).max(65535),
|
||||
enabled: z.boolean().optional().default(true),
|
||||
path: z.string().optional().default("/"),
|
||||
path: z.string().optional(),
|
||||
scheme: z.string().optional(),
|
||||
mode: z.string().default("http"),
|
||||
interval: z.int().default(30),
|
||||
@@ -26,8 +26,10 @@ export const TargetHealthCheckSchema = z.object({
|
||||
.default(null),
|
||||
"follow-redirects": z.boolean().default(true),
|
||||
followRedirects: z.boolean().optional(), // deprecated alias
|
||||
method: z.string().default("GET"),
|
||||
status: z.int().optional()
|
||||
method: z.string().optional(),
|
||||
status: z.int().optional(),
|
||||
"healthy-threshold": z.int().min(1).optional().default(1),
|
||||
"unhealthy-threshold": z.int().min(1).optional().default(1)
|
||||
});
|
||||
|
||||
// Schema for individual target within a resource
|
||||
|
||||
Reference in New Issue
Block a user