fix: use URL.searchParams to parse region query param in /internal/due
This commit is contained in:
parent
8c39fb45c1
commit
e1bb39431d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue