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

How can i update a job progress information ? #37

Closed wemersonrv closed 3 years ago

wemersonrv commented 4 years ago

Hello, i have some jobs that are a bit slow and need to show the running progress.

So, How can i update a job progress information ?

capoia commented 2 years ago

@wemersonrv you can tell me how?

wemersonrv commented 2 years ago

@wemersonrv you can tell me how?

@capoia just call the updateProgress(...) method passing the percentage of progress as an argument. See an example:

 await job.updateProgress(10.33) // 10.33% 

As the adonis-bull is a package to wrap for BullMQ, so i've check the bullmq docs and found a bunch of info. See here: https://api.docs.bullmq.io/classes/Job.html#updateProgress.