Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/10m/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("10-m-cron");
try {
await cron({ periodicity: "10m", req });
await cron({ periodicity: "10m" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/1h/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("1-h-cron");
try {
await cron({ periodicity: "1h", req });
await cron({ periodicity: "1h" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/1m/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("1-m-cron");
try {
await cron({ periodicity: "1m", req });
await cron({ periodicity: "1m" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/30m/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("30-m-cron");
try {
await cron({ periodicity: "30m", req });
await cron({ periodicity: "30m" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/30s/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("30-s-cron");
try {
await cron({ periodicity: "30s", req });
await cron({ periodicity: "30s" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/checker/cron/5m/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function GET(req: NextRequest) {
if (isAuthorizedDomain(req.url)) {
const { cronCompleted, cronFailed } = runSentryCron("5-m-cron");
try {
await cron({ periodicity: "5m", req });
await cron({ periodicity: "5m" });
await cronCompleted();
} catch (_error) {
await cronFailed();
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/app/api/checker/cron/_cron.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CloudTasksClient } from "@google-cloud/tasks";
import type { google } from "@google-cloud/tasks/build/protos/protos";
import type { NextRequest } from "next/server";
import { z } from "zod";

import { and, db, eq, gte, isNotNull, lte, notInArray } from "@openstatus/db";
Expand Down Expand Up @@ -41,9 +40,7 @@ export const isAuthorizedDomain = (url: string) => {

export const cron = async ({
periodicity,
// biome-ignore lint/correctness/noUnusedVariables: <explanation>
req,
}: z.infer<typeof periodicityAvailable> & { req: NextRequest }) => {
}: z.infer<typeof periodicityAvailable>) => {
const client = new CloudTasksClient({
projectId: env.GCP_PROJECT_ID,
credentials: {
Expand Down
4 changes: 0 additions & 4 deletions packages/db/src/schema/monitors/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export const monitorMethodsSchema = z.enum(monitorMethods);
export const monitorStatusSchema = z.enum(monitorStatus);
export const monitorJobTypesSchema = z.enum(monitorJobTypes);

// TODO: shared function
// biome-ignore lint/correctness/noUnusedVariables: <explanation>
function stringToArrayProcess<T>(_string: T) {}

const regionsToArraySchema = z.preprocess((val) => {
if (String(val).length > 0) {
return String(val).split(",");
Expand Down