Menu

Run Vercel Cron more than once a day on the Hobby plan
📰

Run Vercel Cron more than once a day on the Hobby plan

DEV Community: nextjs·Great Work·7 days ago
#cjbpdiEC
#devtonextjs#devto#dev#route#vercel
Reading 0:00
15s threshold

Originally published on RunLater .

On Vercel's Hobby plan a cron job can run at most once a day. A schedule like */15 * * * * fails the deploy with:

Hobby accounts are limited to daily cron jobs.

Enter fullscreen mode

Exit fullscreen mode

Vercel's docs also say Hobby timing is not precise: the job runs at some point within the hour you set.

The usual fix is to keep your cron logic in a normal API route and have an outside scheduler call that route over HTTP. Any scheduler that can send an authenticated request works. The route side is the same whichever you pick.

1. Protect the route with a secret

Your route is a public URL, so check a bearer token before doing any work:

// app/api/cron/sync/route.ts export async function GET ( req : Request ) { if ( req . headers . get ( ' authorization ' ) !== `Bearer ${ process . env . CRON_SECRET } ` ) { return new Response ( ' Unauthorized ' , { status : 401 }); } // ... your job return Response .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.