Quickstart
import { QTask, registerTask } from '@quik/scheduler';
class CleanupTask extends QTask {
public constructor() {
super('cleanup', '0 0 * * *');
}
public async run() {
// cleanup work
}
}
registerTask(CleanupTask);
Notes
QTask's constructor takes a task name and a cron expression (or anIQExecutionPlanobject) as its first argument, with an optional execution plan as the second when a name is provided.registerTask(...tasks)registers task classes on the activeIQScheduleExecutor. It silently does nothing if the scheduler feature has not been initialized.- The scheduler feature is only initialized when the bootstrap
startSchedulerflag is set — registering@quik/schedulerin bootstrap alone does not start it. See Configuration. @quik/schedulerdepends on@quik/entity.