diff --git a/src/routes/api/internal/crons/cleanup/+server.ts b/src/routes/api/internal/crons/cleanup/+server.ts index 3e62076..0ee98c8 100644 --- a/src/routes/api/internal/crons/cleanup/+server.ts +++ b/src/routes/api/internal/crons/cleanup/+server.ts @@ -4,27 +4,16 @@ import * as Sentry from "@sentry/sveltekit"; import { json } from "@sveltejs/kit"; import type { RequestHandler } from "./$types"; -const checkInId = Sentry.captureCheckIn( - { - monitorSlug: "cleanup-cron", +export const GET: RequestHandler = async ({ request }) => { + const checkInId = Sentry.captureCheckIn({ + monitorSlug: "cleanup", status: "in_progress" - }, - { - schedule: { - type: "crontab", - value: "0 12 * * *" - }, - checkinMargin: 0.2, - maxRuntime: 0.2, - timezone: "Etc/UTC" - } -); + }); -export const GET: RequestHandler = async ({ request, fetch }) => { if (!CRON_SECRET || request.headers.get("Authorization") !== `Bearer ${CRON_SECRET}`) { Sentry.captureCheckIn({ checkInId, - monitorSlug: "cleanup-cron", + monitorSlug: "cleanup", status: "error" }); return json( @@ -40,7 +29,7 @@ export const GET: RequestHandler = async ({ request, fetch }) => { await lucia.deleteExpiredSessions(); Sentry.captureCheckIn({ checkInId, - monitorSlug: "cleanup-cron", + monitorSlug: "cleanup", status: "ok" }); return json({ success: true }, { status: 200 }); @@ -48,7 +37,7 @@ export const GET: RequestHandler = async ({ request, fetch }) => { console.error(e); Sentry.captureCheckIn({ checkInId, - monitorSlug: "cleanup-cron", + monitorSlug: "cleanup", status: "error" }); return json({ success: false, error: e }, { status: 500, statusText: "Internal Server Error" }); diff --git a/src/routes/api/internal/crons/minionprice/+server.ts b/src/routes/api/internal/crons/minionprice/+server.ts index c5e743e..17e1616 100644 --- a/src/routes/api/internal/crons/minionprice/+server.ts +++ b/src/routes/api/internal/crons/minionprice/+server.ts @@ -4,27 +4,16 @@ import * as Sentry from "@sentry/sveltekit"; import { json } from "@sveltejs/kit"; import type { RequestHandler } from "./$types"; -const checkInId = Sentry.captureCheckIn( - { - monitorSlug: "minionprice-cron", +export const GET: RequestHandler = async ({ request, fetch }) => { + const checkInId = Sentry.captureCheckIn({ + monitorSlug: "minion-price", status: "in_progress" - }, - { - schedule: { - type: "crontab", - value: "0 12 * * *" - }, - checkinMargin: 0.2, - maxRuntime: 0.2, - timezone: "Etc/UTC" - } -); + }); -export const GET: RequestHandler = async ({ request, fetch }) => { if (!CRON_SECRET || request.headers.get("Authorization") !== `Bearer ${CRON_SECRET}`) { Sentry.captureCheckIn({ checkInId, - monitorSlug: "minionprice-cron", + monitorSlug: "minion-price", status: "error" }); return json( @@ -50,7 +39,7 @@ export const GET: RequestHandler = async ({ request, fetch }) => { Sentry.captureCheckIn({ checkInId, - monitorSlug: "minionprice-cron", + monitorSlug: "minion-price", status: "ok" }); @@ -59,7 +48,7 @@ export const GET: RequestHandler = async ({ request, fetch }) => { console.error(e); Sentry.captureCheckIn({ checkInId, - monitorSlug: "minionprice-cron", + monitorSlug: "minion-price", status: "error" }); return json({ success: false, error: JSON.stringify(e) }, { status: 500, statusText: "Internal Server Error" });