()
| 68 | } |
| 69 | |
| 70 | function recordFailure(): void { |
| 71 | const s = getState(); |
| 72 | const now = Date.now(); |
| 73 | s.failures = s.failures.filter((t) => now - t < RESPAWN_WINDOW_MS); |
| 74 | s.failures.push(now); |
| 75 | if (s.failures.length >= RESPAWN_LIMIT) { |
| 76 | s.brokenCircuit = true; |
| 77 | s.available = false; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | function processBuffer(): void { |
| 82 | const s = getState(); |
no test coverage detected