diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-19 17:16:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-19 17:16:14 +0300 |
| commit | 1a9259eb9a10202c28dbd959e6cfa2e2fcf3e064 (patch) | |
| tree | 8f5884c3189ad65a45d5f28ac5d8d144df9c87b5 /internal/errors/errors_test.go | |
| parent | 655e348870712280eac03d9e32d027e74c119ced (diff) | |
Fix dgrep transmission percentage display
The dgrep tool was showing 0% transmission rate in non-plain mode even when all matched lines were successfully transmitted. This was due to incorrect stats tracking.
The issue was that DirectProcessor was updating stats position for every line read from the file, but GrepProcessor was only returning results for matching lines. This caused the stats array position to advance for non-matching lines, breaking the percentage calculation.
Fixed by:
1. Moving updatePosition() call to only happen when a line will be sent
2. Having DirectProcessor call updateLineMatched() for all sent lines
3. Removing duplicate updateLineMatched() calls from GrepProcessor
4. Ensuring stats are consistently updated in DirectProcessor, not in individual processors
Now dgrep correctly shows 100% (green) when all matched lines are transmitted.
Diffstat (limited to 'internal/errors/errors_test.go')
0 files changed, 0 insertions, 0 deletions
