heartbeatInterval returns a safe ticker interval for stream heartbeats. It is half the stale threshold so at least one touch lands before the stale sweep considers the row abandoned. The result is clamped to a minimum of 1 ms to prevent panics from time.NewTicker(0) with pathologically small thresh
()
| 206 | // pathologically small thresholds, while still staying well below any |
| 207 | // practical stale timeout. |
| 208 | func (s *Service) heartbeatInterval() time.Duration { |
| 209 | return max(s.staleThreshold()/2, time.Millisecond) |
| 210 | } |
| 211 | |
| 212 | func chatdContext(ctx context.Context) context.Context { |
| 213 | //nolint:gocritic // AsChatd provides narrowly-scoped daemon access for |
no test coverage detected