(consecutiveSuccesses: number)
| 23 | * Exported for testing purposes |
| 24 | */ |
| 25 | export 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. |
no outgoing calls
no test coverage detected