In BullMQ, you can track the progress of a job by using the
progress method. This is useful when dealing with long-running jobs where you'd like to provide some kind of feedback or persistence of progress over time.
To set the progress of a job, you would typically do it from within the process function itself:
You can also listen to the progress updates using on event listener:
Remember that the
progress data you send can be any valid JSON data type. This means you could send an object with more complex and detailed information if needed, but keep in mind that this will increase the network overhead, so it's a balance between level of detail and performance impact.