WithStaleThreshold overrides the default stale-row finalization threshold. Callers that already have a configurable in-flight chat timeout (e.g. chatd's InFlightChatStaleAfter) should pass it here so the two sweeps stay in sync.
(d time.Duration)
| 54 | // timeout (e.g. chatd's InFlightChatStaleAfter) should pass it here |
| 55 | // so the two sweeps stay in sync. |
| 56 | func WithStaleThreshold(d time.Duration) ServiceOption { |
| 57 | return func(s *Service) { |
| 58 | if d > 0 { |
| 59 | s.staleAfterNanos.Store(d.Nanoseconds()) |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | // WithAlwaysEnable forces debug logging on for every chat regardless |
| 65 | // of the runtime admin and user opt-in settings. This is used for the |