@@ -23,7 +23,7 @@ import { Agent } from "agents"
2323export class SchedulingAgent extends Agent {
2424 async onRequest(request ) {
2525 // Handle an incoming request
26- // Schedule a task 5 minutes from now
26+ // Schedule a task 10 minutes from now
2727 // Calls the "checkFlights" method
2828 let { taskId } = await this .schedule (600 , " checkFlights" , { flight: " DL264" , date: " 2025-02-23" });
2929 return Response .json ({ taskId });
@@ -54,11 +54,11 @@ let task = await this.schedule(10, "someTask", { message: "hello" });
5454// schedule a task to run at a specific date
5555let task = await this .schedule (new Date (" 2025-01-01" ), " someTask" , {});
5656
57- // schedule a task to run every 10 seconds
57+ // schedule a task to run every 10 minutes
5858let { id } = await this .schedule (" */10 * * * *" , " someTask" , { message: " hello" });
5959
60- // schedule a task to run every 10 seconds , but only on Mondays
61- let task = await this .schedule (" 0 0 * * 1" , " someTask" , { message: " hello" });
60+ // schedule a task to run every 10 minutes , but only on Mondays
61+ let task = await this .schedule (" */10 * * * 1" , " someTask" , { message: " hello" });
6262
6363// cancel a scheduled task
6464this .cancelSchedule (task .id );
0 commit comments