MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getNextInterval

Function getNextInterval

cli/src/hooks/use-connection-status.ts:25–34  ·  view source on GitHub ↗
(consecutiveSuccesses: number)

Source from the content-addressed store, hash-verified

23 * Exported for testing purposes
24 */
25export function getNextInterval(consecutiveSuccesses: number): number {
26 // Find the highest threshold that we've passed
27 for (let i = HEALTH_CHECK_CONFIG.INTERVALS.length - 1; i >= 0; i--) {
28 const { successCount, interval } = HEALTH_CHECK_CONFIG.INTERVALS[i]
29 if (consecutiveSuccesses >= successCount) {
30 return interval
31 }
32 }
33 return HEALTH_CHECK_CONFIG.INITIAL_INTERVAL
34}
35
36/**
37 * Hook to monitor connection status to the Codebuff backend.

Callers 2

checkConnectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected