272
273
// UpdateSimpleRateLimit updates the overall queue rate limits for the simpleRateLimiter implementation
274
>
func (r *rateLimitManager) updateSimpleRateLimitWithBurstLocked(burstDuration time.Duration) {
ratelimit_manager.go
275
>
newRPS := r.effectiveRPS
276
>
r.wholeQueueLimit = makeSimpleLimiterParams(newRPS, burstDuration)
277
>
278
>
// Clip to handle the case where we have increased from a zero or very low limit and had
279
>
// ready times in the far future.
280
>
now := r.timeSource.Now().UnixNano()
281
>
r.wholeQueueReady = r.wholeQueueReady.clip(r.wholeQueueLimit, now, maxTokens)
282
>
}
283
284
// UpdatePerKeySimpleRateLimit updates the per-key rate limit for the simpleRateLimit implementation