Background Jobs

Scheduler

Cron-based task scheduling.

1 min readDocumentationEdit this page

Usage#

typescript
import { Scheduler } from '@AxilJS/queue'
 
const scheduler = new Scheduler()
 
scheduler.schedule('daily-report', '0 9 * * *', sendReport)
scheduler.schedule('cleanup',      '0 2 * * *', cleanupData)
 
scheduler.start()
await scheduler.runNow('daily-report')

Cron format#

minute hour day month weekday

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY