Hi all! I am struggling to get my progress bar to work right. I have a stream that loads tasks from a database.
- The tasks are stored in a list attribute
self.examplesinside the stream.
- The stream has a
__len__method which returns the length of the list.
- The stream implements
__iter__by returning the iterator of the list, i.e.
- I deduplicate the tasks in the list by their task hash when I fetch them from the database.
- I compute progress by dividing
controller.total_annotatedby the length of the stream.
In my test case, there are a total of 9 tasks, meaning that each should lead to a progress of about 11%. All of the tasks have both a unique
_task_hash and a unique
The first time I accept, reject, or ignore a task, the progress bar is not updated and stays at 0%.
Once I have processed all 9 tasks, the final progress comes out to 89%, even though 9 answers were given and recorded in the database.
Any ideas what might be going wrong?