fix: use URL.searchParams to parse region query param in /internal/due

This commit is contained in:
M1 2026-03-18 16:21:24 +04:00
parent 8c39fb45c1
commit e1bb39431d
1 changed files with 2 additions and 2 deletions

View File

@ -33,8 +33,8 @@ export const internal = new Elysia({ prefix: "/internal", detail: { hide: true }
// Returns monitors that are due for a check.
// scheduled_at = last_checked_at + interval_s (ideal fire time), so jitter = actual_start - scheduled_at
.get("/due", async ({ query }) => {
const region = query.region as string | undefined;
.get("/due", async ({ request }) => {
const region = new URL(request.url).searchParams.get('region') || undefined;
const monitors = await sql`
SELECT m.id, m.url, m.method, m.request_headers, m.request_body, m.timeout_ms, m.interval_s, m.query, m.regions,
CASE