File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,9 @@ export class FipeClient {
5050
5151 private recordSuccess ( ) : void {
5252 this . successCount ++ ;
53- // After 5 consecutive successes, halve the distance to baseline
54- if ( this . successCount >= 5 && this . currentThrottleMs > env . RATE_LIMIT_MS ) {
55- const newThrottle = Math . max (
56- Math . floor ( ( this . currentThrottleMs + env . RATE_LIMIT_MS ) / 2 ) ,
57- env . RATE_LIMIT_MS ,
58- ) ;
53+ // After 10 consecutive successes, reduce throttle by 25%
54+ if ( this . successCount >= 10 && this . currentThrottleMs > env . RATE_LIMIT_MS ) {
55+ const newThrottle = Math . max ( Math . floor ( this . currentThrottleMs * 0.75 ) , env . RATE_LIMIT_MS ) ;
5956 if ( newThrottle !== this . currentThrottleMs ) {
6057 console . log (
6158 `Throttle recovery: decreasing from ${ this . currentThrottleMs } ms to ${ newThrottle } ms` ,
You can’t perform that action at this time.
0 commit comments