MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / parseWatchdogTimeoutMs

Function parseWatchdogTimeoutMs

src/mcp/liveness-watchdog.ts:75–82  ·  view source on GitHub ↗
(
  raw: string | undefined,
  fallback: number = DEFAULT_WATCHDOG_TIMEOUT_MS
)

Source from the content-addressed store, hash-verified

73
74/** Parse the timeout env, falling back to the default for missing/invalid values. */
75export function parseWatchdogTimeoutMs(
76 raw: string | undefined,
77 fallback: number = DEFAULT_WATCHDOG_TIMEOUT_MS
78): number {
79 if (raw === undefined) return fallback;
80 const n = Number(raw);
81 return Number.isFinite(n) && n > 0 ? n : fallback;
82}
83
84/** Derive a heartbeat cadence that emits several beats inside the timeout window. */
85export function deriveCheckIntervalMs(timeoutMs: number): number {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected