Openstatus www.openstatus.dev

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>

authored by

Maximilian Kaske
autofix-ci[bot]
and committed by
GitHub
dbbcca42 8353e97a

+6 -34
-24
apps/web/vercel.json
··· 1 1 { 2 2 "crons": [ 3 3 { 4 - "path": "/api/checker/cron/30s", 5 - "schedule": "* * * * *" 6 - }, 7 - { 8 - "path": "/api/checker/cron/1m", 9 - "schedule": "* * * * *" 10 - }, 11 - { 12 - "path": "/api/checker/cron/5m", 13 - "schedule": "*/5 * * * *" 14 - }, 15 - { 16 - "path": "/api/checker/cron/10m", 17 - "schedule": "*/10 * * * *" 18 - }, 19 - { 20 - "path": "/api/checker/cron/30m", 21 - "schedule": "*/30 * * * *" 22 - }, 23 - { 24 - "path": "/api/checker/cron/1h", 25 - "schedule": "0 * * * *" 26 - }, 27 - { 28 4 "path": "/api/internal/email", 29 5 "schedule": "00 17 * * *" 30 6 }
+6 -10
apps/workflows/src/cron/checker.ts
··· 30 30 31 31 const channelOptions = { 32 32 // Conservative 5-minute keepalive (gRPC best practice) 33 - 'grpc.keepalive_time_ms': 300000, 33 + "grpc.keepalive_time_ms": 300000, 34 34 // 5-second timeout sufficient for ping response 35 - 'grpc.keepalive_timeout_ms': 5000, 35 + "grpc.keepalive_timeout_ms": 5000, 36 36 // Disable pings without active calls to avoid server conflicts 37 - 'grpc.keepalive_permit_without_calls': 1, 37 + "grpc.keepalive_permit_without_calls": 1, 38 38 }; 39 39 40 - 41 40 export async function sendCheckerTasks( 42 41 periodicity: z.infer<typeof monitorPeriodicitySchema>, 43 42 ) { 44 - 45 - 46 43 const client = new CloudTasksClient({ 47 - fallback:"rest", 44 + fallback: "rest", 48 45 channelOptions, 49 46 projectId: env().GCP_PROJECT_ID, 50 47 credentials: { ··· 159 156 160 157 const success = allRequests.filter((r) => r.status === "fulfilled").length; 161 158 const failed = allRequests.filter((r) => r.status === "rejected").length; 162 - const failedRequest = allRequests.filter((r) => r.status === "rejected") 159 + const failedRequest = allRequests.filter((r) => r.status === "rejected"); 163 160 164 - 165 - console.log(failedRequest?.at(0)) 161 + console.log(failedRequest?.at(0)); 166 162 console.log( 167 163 `End cron for ${periodicity} with ${allResult.length} jobs with ${success} success and ${failed} failed`, 168 164 );