Commit 72c9ca7
committed
fix(worker): guard average-time print on compute_time list, not analytics_line_count
PR #81 used analytics_line_count > 0 as the divide-by-zero guard, but
that variable is incremented at the top of the analytics loop —
before the 'if not event_type: continue' skip. So a file whose lines
all lack event_type (Discord apparently ships these for some kinds of
partial exports) re-hit the same ZeroDivisionError surfaced as
UNKNOWN_ERROR for package 14be73071701467d3aae144ab2e72f86.
The actual condition for 'we have nothing to average' is that
compute_time_per_line is empty. Guard on it directly. Behavior is
identical for the two clean cases (empty file, fully-populated file)
and additionally handles the lines-without-event_type case gracefully
— is_partial stays True, no stats produced, no crash.1 parent bb688fb commit 72c9ca7
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
437 | 444 | | |
438 | 445 | | |
439 | 446 | | |
440 | | - | |
| 447 | + | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
| |||
0 commit comments