chore: remove limits during testing
This commit is contained in:
parent
34fd66f784
commit
1495da41fa
|
|
@ -10,7 +10,7 @@ const MonitorBody = t.Object({
|
|||
request_headers: t.Optional(t.Any({ description: "Request headers as key-value object" })),
|
||||
request_body: t.Optional(t.Nullable(t.String({ description: "Request body for POST/PUT/PATCH" }))),
|
||||
timeout_ms: t.Optional(t.Number({ minimum: 1000, maximum: 60000, default: 30000, description: "Request timeout in ms" })),
|
||||
interval_s: t.Optional(t.Number({ minimum: 30, default: 60, description: "Check interval in seconds" })),
|
||||
interval_s: t.Optional(t.Number({ minimum: 10, default: 60, description: "Check interval in seconds" })),
|
||||
query: t.Optional(t.Any({ description: "PingQL query — filter conditions for up/down" })),
|
||||
});
|
||||
|
||||
|
|
@ -28,11 +28,6 @@ export const monitors = new Elysia({ prefix: "/monitors" })
|
|||
const ssrfError = await validateMonitorUrl(body.url);
|
||||
if (ssrfError) return error(400, { error: ssrfError });
|
||||
|
||||
// Monitor count limit
|
||||
const [{ count }] = await sql`SELECT COUNT(*)::int AS count FROM monitors WHERE account_id = ${accountId}`;
|
||||
const limit = Number(process.env.MAX_MONITORS_PER_ACCOUNT ?? 100);
|
||||
if (count >= limit) return error(429, { error: `Monitor limit reached (max ${limit})` });
|
||||
|
||||
const [monitor] = await sql`
|
||||
INSERT INTO monitors (account_id, name, url, method, request_headers, request_body, timeout_ms, interval_s, query)
|
||||
VALUES (
|
||||
|
|
|
|||
Loading…
Reference in New Issue