Provide the implementing developer a way to set the total number of items in the progress bar. As of now, it is set to the max id, which isn't necessarily the number of items being processed.
Use Case
In my use case, I'm only processing about a tenth of the database, so after I create the Bulk_Task object, I'm setting the cursor to the value (1 less than that which) I want to start at. When I start the command, the progress bar is 90% progressed, because my start ID is roughly 90% of the max id.
Implementation ideas:
We could fire an action at the end of before_run() (and after_run()), which would be enough to let a developer control the progress bar.
We could choose to only set the total if it hasn't already been set, giving developers the ability to set it themselves.
Description
Provide the implementing developer a way to set the total number of items in the progress bar. As of now, it is set to the max id, which isn't necessarily the number of items being processed.
Use Case
In my use case, I'm only processing about a tenth of the database, so after I create the
Bulk_Task
object, I'm setting the cursor to the value (1 less than that which) I want to start at. When I start the command, the progress bar is 90% progressed, because my start ID is roughly 90% of the max id.Implementation ideas:
before_run()
(andafter_run()
), which would be enough to let a developer control the progress bar.