diff --git a/src/content/docs/agents/api-reference/schedule-tasks.mdx b/src/content/docs/agents/api-reference/schedule-tasks.mdx index 382133b9edea3c6..90fd71ccc0984a5 100644 --- a/src/content/docs/agents/api-reference/schedule-tasks.mdx +++ b/src/content/docs/agents/api-reference/schedule-tasks.mdx @@ -23,7 +23,7 @@ import { Agent } from "agents" export class SchedulingAgent extends Agent { async onRequest(request) { // Handle an incoming request - // Schedule a task 5 minutes from now + // Schedule a task 10 minutes from now // Calls the "checkFlights" method let { taskId } = await this.schedule(600, "checkFlights", { flight: "DL264", date: "2025-02-23" }); return Response.json({ taskId }); @@ -54,11 +54,11 @@ let task = await this.schedule(10, "someTask", { message: "hello" }); // schedule a task to run at a specific date let task = await this.schedule(new Date("2025-01-01"), "someTask", {}); -// schedule a task to run every 10 seconds +// schedule a task to run every 10 minutes let { id } = await this.schedule("*/10 * * * *", "someTask", { message: "hello" }); -// schedule a task to run every 10 seconds, but only on Mondays -let task = await this.schedule("0 0 * * 1", "someTask", { message: "hello" }); +// schedule a task to run every 10 minutes, but only on Mondays +let task = await this.schedule("*/10 * * * 1", "someTask", { message: "hello" }); // cancel a scheduled task this.cancelSchedule(task.id);