520
521
// call with lock held. Returns true if a match was found but blocked by rate limiting.
522
>
func (d *matcherData) findAndWakeMatches() (rateLimited bool) {
matcher_data.go
523
>
allowForwarding := d.canForward && d.allowForwarding()
524
>
525
>
now := d.timeSource.Now().UnixNano()
526
>
527
>
for {
528
>
// search for highest-priority ready match; skip per-key rate-limited tasks
529
>
task, poller, minDelay := d.findMatch(allowForwarding, now)
530
>
if task == nil || poller == nil {
531
>
if minDelay > 0 {
532
d.rateLimitTimer.set(d.timeSource, d.rematchAfterTimer, minDelay)
533
d.onRateLimited()