Add optional rate limiting between API calls

This commit is contained in:
Matt Rubens
2025-01-31 14:17:09 -05:00
parent 9acc21c372
commit 9aeb498f99
9 changed files with 80 additions and 3 deletions

View File

@@ -750,8 +750,11 @@ describe("Cline", () => {
false,
)
// Verify delay was called correctly
expect(mockDelay).toHaveBeenCalledTimes(baseDelay)
// Calculate expected delay calls based on exponential backoff
const exponentialDelay = Math.ceil(baseDelay * Math.pow(2, 1)) // retryAttempt = 1
const rateLimitDelay = baseDelay // Initial rate limit delay
const totalExpectedDelays = exponentialDelay + rateLimitDelay
expect(mockDelay).toHaveBeenCalledTimes(totalExpectedDelays)
expect(mockDelay).toHaveBeenCalledWith(1000)
// Verify error message content