Overview
- One-shot task: Triggered once at the next matching time, then automatically deleted.
- Periodic Task: Triggered repeatedly according to a Cron schedule until deleted or automatically expired.
Creating Scheduled Tasks
/loop. See Scheduled Execution Task (/loop).
Cron Expression
*, Single Value N, Step */N, Range N-M, List N,M,.... In the day-of-week field, 7 is treated as Sunday (equivalent to 0).
L, W, ?, and Name Alias (such as MON) are not supported, nor is there a seconds field.
Examples:
| Cron | Meaning |
|---|---|
*/5 * * * * | Every 5 minutes |
0 * * * * | Every hour on the hour |
0 9 * * * | Every day at 9:00 AM |
30 14 28 2 * | February 28 at 2:30 PM (once in the current year) |
0 10 * * 1 | Every Monday at 10:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
All times are interpreted in the local time zone where the CLI is running. For example, 0 9 * * * means 9:00 AM every day in the CLI's time zone.
Storage and Persistence
- persistent task: Written to
<project>/.qoder/scheduled_tasks.jsonin the project root directory, and persists across process restarts. - in-session task: Stored only in memory, and disappears when the current session ends.
Execution Limits
- Maximum number of tasks: Up to 50 tasks. Once the limit is reached, you must delete existing tasks before creating new ones.
- Periodic Task auto-expiration: Periodic tasks automatically expire 7 days after creation, unless deleted earlier. Tasks that need to run long-term must be recreated.
- Minimum granularity: Since there is no seconds field, the minimum scheduling granularity is 1 minute.
- Single-process driven: A file lock ensures that only one process drives the scheduling for the same project directory, preventing duplicate triggers.