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

Method staleThreshold

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

staleThreshold returns the current stale timeout.

()

Source from the content-addressed store, hash-verified

191
192// staleThreshold returns the current stale timeout.
193func (s *Service) staleThreshold() time.Duration {
194 ns := s.staleAfterNanos.Load()
195 d := time.Duration(ns)
196 if d <= 0 {
197 return DefaultStaleThreshold
198 }
199 return d
200}
201
202// heartbeatInterval returns a safe ticker interval for stream heartbeats.
203// It is half the stale threshold so at least one touch lands before the

Callers 2

heartbeatIntervalMethod · 0.95
FinalizeStaleMethod · 0.95

Calls 2

DurationMethod · 0.80
LoadMethod · 0.45

Tested by

no test coverage detected