mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 11:13:26 +00:00
bf6261adc6
The deferred recordTaskResult call was passing pollErr as a function argument, so it captured the value at defer-time (always nil) instead of the value at execution time. Result: the per-instance pollStatusMap treated every poll as a success — LastSuccess was set to "now" on every cycle, ConsecutiveFailures stayed at zero, and the circuit breaker never opened, even when the staleness tracker (which used a proper closure) recorded the same poll as a failure. The connections aggregator derives state from PollStatus.LastSuccess, so the Connections UI reported broken PVE/PBS/PMG instances as "active / verified / healthy" while no data was ingested. Wrap the recordTaskResult call in a defer closure so it reads the live pollErr at execution time, matching the pollMetrics and stalenessTracker defers immediately above.