Audit item #9. pollPrices() and refreshStations() shared the same do/while batch loop with token + try/catch + Log::error + clean-exit detection but different bodies. Extracted to a private iterateBatches() that takes the endpoint, optional since timestamp, and a process callable. Returns [total_processed, completedCleanly] so pollPrices can still gate its incremental-poll cache update on a clean exhaustion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13 KiB
13 KiB