This is an scheduler Payload CMS plugin.
It allows to create callbacks and execute these at a given schedule.
Here is a short recap on how to integrate plugins with Payload, to learn more visit the plugin overview page.
To install this plugin, simply add it to your payload.config() in the Plugin array.
import { schedulePlugin } from 'payload-plugin-schedule';
export const config = buildConfig({
plugins: [
// You can pass options to the plugin
schedulePlugin({
enabled: true,
scheduler: [
{
callback: () => console.log("This will be printed once per minute.")
},
{
schedule: "*/5 * * * *",
callback: (payload) => {
// We can do something with the payload object. For example use the local API
}
}
]
}),
]
});