Skip to main content

Writing your own Scheduler handler

The easiest way to write your own scheduler is by referencing the one already created.

The core of it is the following:

import { getScheduledTasks, runScheduledTask } from '@vramework/core/scheduler'

const run = async (singletonServices: SingletonServices, name: string) => {
const { scheduledTasks } = getScheduleTasks()
await runScheduledTask({
singletonServices: this.singletonServices,
name,
})
}

The rest of it is code to get it work on a cron timer:

VrameworkTaskScheduler
loading...