MCPcopy Index your code
hub / github.com/coder/coder / WithStaleThreshold

Function WithStaleThreshold

coderd/x/chatd/chatdebug/service.go:56–62  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

54// timeout (e.g. chatd's InFlightChatStaleAfter) should pass it here
55// so the two sweeps stay in sync.
56func 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

Callers 1

TestLaunchHeartbeatFunction · 0.85

Calls 1

StoreMethod · 0.45

Tested by 1

TestLaunchHeartbeatFunction · 0.68