You've waited for it, now it will wait for you.
The Job Scheduler allows you to schedule code to run at specified intervals. You schedule code to run by creating a job.
Each job defines what code to run and when to run it. The code your job runs can be any backend function. You can schedule that code to run on a daily, weekly, or monthly basis.
For example, you might create jobs that:
Import data from an external source once a day.
Delete collection data that is no longer relevant once a week.
Send a status report to relevant parties once a month.
How it works
You configure what jobs to run and when to run them in a jobs.config file in your site's backend.
The contents of the file look will look something like this:
{
"jobs": [
{
// first job object
"functionLocation": "/utils/dbUtils.js",
"functionName": "deleteExpired",
"description": "Delete expired DB items",
"executionConfig": {
"time": "22:00",
"dayOfWeek": "Sunday"
}
}, {
// another job object
}
]
}
For more information, see Scheduling Recurring Jobs.