Rocketseat / adonis-bull

The easiest way to start using an asynchronous job queue with AdonisJS. Ready for Adonis v5 ⚡️
MIT License
310 stars 57 forks source link

Where can I define my Bull.add() functions to schedule daily cron tasks? #65

Closed LeCoupa closed 3 years ago

LeCoupa commented 3 years ago

Thanks again for the migration to Adonis5. :)

I am wondering where I can set up my job tasks that should occur daily. Something that should happen when the Adonis server has started.

import Bull from '@ioc:Rocketseat/Bull'

Bull.add('MyJobKey', {}, { repeat: { cron: "0 30 12 * * WED,FRI" })

If you have any idea. In the past, I was using an Igniter hook but I don't know if there is an equivalent for Adonis 5 :)

LeCoupa commented 3 years ago

FYI, the best is to use a provider :)

https://github.com/adonisjs/core/discussions/2188#discussioncomment-322869