mirror of
https://github.com/sern-handler/website
synced 2026-06-24 08:42:31 +00:00
1.1 KiB
1.1 KiB
editUrl, next, prev, title
| editUrl | next | prev | title |
|---|---|---|---|
| false | false | false | scheduledTask |
scheduledTask(
ism):ScheduledTask
Creates a scheduled task that can be executed at specified intervals using cron patterns
Parameters
• ism: ScheduledTask
The scheduled task configuration object
Returns
The configured scheduled task
Example
// Create a task that runs every minute
export default scheduledTask({
trigger: "* * * * *",
execute: (context) => {
console.log("Task executed!");
}
});
Remarks
- Tasks must be placed in the 'tasks' directory specified in your config
- The file name serves as a unique identifier for the task
- Tasks can be cancelled using deps['@sern/scheduler'].kill(uuid)
See
https://crontab.guru/ for testing and creating cron patterns