SetStaleAfter overrides the in-flight stale threshold used when finalizing abandoned debug rows. Zero or negative durations are ignored, leaving the current threshold (initial or previously overridden) unchanged. Active heartbeat goroutines are woken so they can re-read the (possibly shorter) interv
(staleAfter time.Duration)
| 167 | // overridden) unchanged. Active heartbeat goroutines are woken so |
| 168 | // they can re-read the (possibly shorter) interval immediately. |
| 169 | func (s *Service) SetStaleAfter(staleAfter time.Duration) { |
| 170 | if s == nil || staleAfter <= 0 { |
| 171 | return |
| 172 | } |
| 173 | s.staleAfterNanos.Store(staleAfter.Nanoseconds()) |
| 174 | |
| 175 | // Wake all heartbeat goroutines by closing the current channel |
| 176 | // and replacing it with a fresh one for the next update. |
| 177 | s.thresholdMu.Lock() |
| 178 | close(s.thresholdChanged) |
| 179 | s.thresholdChanged = make(chan struct{}) |
| 180 | s.thresholdMu.Unlock() |
| 181 | } |
| 182 | |
| 183 | // thresholdChan returns the current threshold-change notification |
| 184 | // channel. Heartbeat goroutines select on this to detect runtime |