From dbbcca425b4705a0789556ab92c8ed347430627d Mon Sep 17 00:00:00 2001 From: Maximilian Kaske <56969857+mxkaske@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:24:11 +0200 Subject: [PATCH] wtf: vercel cron (#1464) * wtf: vercel cron * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- apps/web/vercel.json | 24 ------------------------ apps/workflows/src/cron/checker.ts | 16 ++++++---------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/apps/web/vercel.json b/apps/web/vercel.json index e8e668b8..e317722f 100644 --- a/apps/web/vercel.json +++ b/apps/web/vercel.json @@ -1,29 +1,5 @@ { "crons": [ - { - "path": "/api/checker/cron/30s", - "schedule": "* * * * *" - }, - { - "path": "/api/checker/cron/1m", - "schedule": "* * * * *" - }, - { - "path": "/api/checker/cron/5m", - "schedule": "*/5 * * * *" - }, - { - "path": "/api/checker/cron/10m", - "schedule": "*/10 * * * *" - }, - { - "path": "/api/checker/cron/30m", - "schedule": "*/30 * * * *" - }, - { - "path": "/api/checker/cron/1h", - "schedule": "0 * * * *" - }, { "path": "/api/internal/email", "schedule": "00 17 * * *" diff --git a/apps/workflows/src/cron/checker.ts b/apps/workflows/src/cron/checker.ts index 0940b21f..8b4f2eda 100644 --- a/apps/workflows/src/cron/checker.ts +++ b/apps/workflows/src/cron/checker.ts @@ -30,21 +30,18 @@ export const isAuthorizedDomain = (url: string) => { const channelOptions = { // Conservative 5-minute keepalive (gRPC best practice) - 'grpc.keepalive_time_ms': 300000, + "grpc.keepalive_time_ms": 300000, // 5-second timeout sufficient for ping response - 'grpc.keepalive_timeout_ms': 5000, + "grpc.keepalive_timeout_ms": 5000, // Disable pings without active calls to avoid server conflicts - 'grpc.keepalive_permit_without_calls': 1, + "grpc.keepalive_permit_without_calls": 1, }; - export async function sendCheckerTasks( periodicity: z.infer, ) { - - const client = new CloudTasksClient({ - fallback:"rest", + fallback: "rest", channelOptions, projectId: env().GCP_PROJECT_ID, credentials: { @@ -159,10 +156,9 @@ export async function sendCheckerTasks( const success = allRequests.filter((r) => r.status === "fulfilled").length; const failed = allRequests.filter((r) => r.status === "rejected").length; - const failedRequest = allRequests.filter((r) => r.status === "rejected") - + const failedRequest = allRequests.filter((r) => r.status === "rejected"); - console.log(failedRequest?.at(0)) + console.log(failedRequest?.at(0)); console.log( `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed`, ); -- 2.51.2