For create a new periodic task, you can use the command line, bun g
, select the “task” option and enter the task name. As the first argument of the createSchedule
function, you will use the cron format. For the second argument, you must pass the task function.
We use the node-cron library under the hood, so for more information, visit the official documentation at https://github.com/node-cron/node-cron
Lastly, you must register the new task by going to app/tasks/index.ts, importing the new task and passing it to this.jobs, within the constructor, as shown in the example code present in the project.