in03/proxima

Divide by zero error in queuer progress

Closed this issue · 1 comments

in03 commented

Queuer crashes with a divide by zero error when working queuing lots of proxies.
Looks like the discrete progress (total task progress) reaches completion well before all proxies have finished.

│ C:\Users\Caleb\.local\pipx\venvs\resolve-proxy-encoder\lib\site-packages\resolve_proxy_encoder\a │
│ pp\broker.py:312 in report_progress                                                              │
│                                                                                                  │
│   309 │   │   │   │   │   self.handle_task_event(te)                                             │
│   310 │   │   │   │                                                                              │
│   311 │   │   │   │   for pe in progress_events:                                                 │
│ ❱ 312 │   │   │   │   │   self.handle_task_progress(pe)                                          │
│   313 │   │   │   │                                                                              │
│   314 │   │   │   │   # Let's be nice to the server ;)                                           │
│   315 │   │   │   │   time.sleep(loop_delay)                                                     │
│                                                                                                  │
│ C:\Users\Caleb\.local\pipx\venvs\resolve-proxy-encoder\lib\site-packages\resolve_proxy_encoder\a │
│ pp\broker.py:258 in handle_task_progress                                                         │
│                                                                                                  │
│   255 │   │   │   try:                                                                           │
│   256 │   │   │   │   total_task_average = round(                                                │
│   257 │   │   │   │   │   active_task_average                                                    │
│ ❱ 258 │   │   │   │   │   / (len(self.callable_tasks) - self.completed_tasks)                    │
│   259 │   │   │   │   )                                                                          │
│   260 │   │   │   except DivisionByZero:                                                         │
│   261 │   │   │   │   total_task_average = 0

self.completed_tasks must be decrementing faster than it should be for some reason?
May be the task handler is running multiple times for the same messages? Better check the checksums are working properly.

in03 commented

Pushed a hotfix straight to main. Fixed in 0db7155.