mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Add optional rate limiting between API calls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user