Skip to main content

ApplicationScheduledService

In your application, you may find yourself needing to run hourly, weekly, daily jobs, etc... In these contexts, you can leverage your ApplicationScheduledService class to schedule using a beautiful, cron-driven api, courtesy of bullmq under the hood.

import ApplicationScheduledService from '../ApplicationScheduledService'
import HourProcessor from './HourProcessor'

export default class ScheduledJobs extends ApplicationScheduledService {
public static async scheduleAllJobs() {
await this.schedule('0 * * * *', 'processHour')
}

public static async processHour() {
await HourProcessor.process(DateTime.now())
}
}