본문으로 건너뛰기
AI NEWS JOURNAL
VercelAI NEWS / JOURNAL

Vercel Schedules is now in public beta

Vercel Schedules is now available in public beta across all plans, enabling users to run tasks on a recurring basis or at a specific time in production, preview, or custom environments. It supports targeting private Vercel Functions, HTTP paths, or Queue topics, with schedules definable in vercel.json or created at runtime. Static schedules use cron expressions and require an experimental trigger to make functions private, while runtime schedules dispatch to Queue topics. Schedules replace Cron Jobs, with billing starting at $5 per 1M runs and $10 per 1M creations on Pro and Enterprise plans, and Hobby plan includes 500 schedule creations and 5,000 runs monthly.

번역 서비스가 일시 중지되어 원문을 표시합니다.

Vercel Schedules is now in public beta on all plans. Run tasks on a recurring cadence or at a single point in time, in production, preview, or custom environments. Schedules in vercel.json can target a private Vercel Function, an HTTP path, or a Vercel Queue topic, and schedules created at runtime target a Queue topic. Any schedule can be enabled, disabled, or run on demand without redeploying. Define a static schedule: { "schedules": { "cleanup": { "schedule": "0 * * * *", "function": "api/cleanup.ts", "timezone": "America/New_York" } }, "functions": { "api/cleanup.ts": { "experimentalTriggers": [{ "type": "schedule/v1beta" }] } } } An hourly static schedule in vercel.json, targeting a private Vercel Function Adding a schedule/v1beta trigger makes the function private. It has no public URL and only the Vercel schedule infrastructure can invoke it. Handle the dispatch: import { handleSchedule } from '@vercel/schedules'; export const POST = handleSchedule(async (metadata) => { console.log(`Running ${metadata.name} at ${metadata.scheduledAt}`); await deleteExpiredRecords(); }); Handling the schedule dispatch with handleSchedule from @vercel/schedules Create a schedule at runtime: import { Schedules } from '@vercel/schedules'; await Schedules.create({ name: 'daily-digest', target: { topic: 'digests' }, expression: { type: 'cron', cron: '0 9 * * *' }, timezone: 'America/Los_Angeles', payload: { reportType: 'summary' },}); Creating a schedule at runtime that dispatches to a Queue topic Schedules is the successor to Cron Jobs. Existing Cron Jobs continue to work, and the migration guide covers moving them to Schedules. Schedules also power dynamic schedules in Eve and experimental scheduled tasks in Nitro projects. Vercel Schedules is billed starting at $5 per 1M runs and $10 per 1M creations on Pro and Enterprise. Hobby includes 500 schedule creations and 5,000 runs per month. Read the blog post for more on how Schedules works, then get started with the Schedules documentation.

자료 출처

원문 읽기 ↗

관련 주제

← 전체 소식 이어 읽기