334
}
335
336
>
func (r *rateLimitManager) readyTimeForTask(task *internalTask) simpleLimiter {
ratelimit_manager.go
337
>
r.mu.Lock()
338
>
defer r.mu.Unlock()
339
>
// TODO(pri): after we have task-specific ready time, we can re-enable this
340
>
// if task.isForwarded() {
341
>
// // don't count any rate limit for forwarded tasks, it was counted on the child
342
>
// return 0
343
>
// }
344
>
ready := r.wholeQueueReady
345
>
346
>
if r.perKeyLimit.limited() {
347
>
key := task.getPriority().GetFairnessKey()
348
>
if v := r.perKeyReady.Get(key); v != nil {
349
>
ready = max(ready, v.(simpleLimiter))
350
>
}
351
}
352
354
}
355