shouldResync queries every listener to determine if any of them need a resync, based on each listener's resyncPeriod.
()
| 487 | // shouldResync queries every listener to determine if any of them need a resync, based on each |
| 488 | // listener's resyncPeriod. |
| 489 | func (p *sharedProcessor) shouldResync() bool { |
| 490 | p.listenersLock.Lock() |
| 491 | defer p.listenersLock.Unlock() |
| 492 | |
| 493 | p.syncingListeners = []*processorListener{} |
| 494 | |
| 495 | resyncNeeded := false |
| 496 | now := p.clock.Now() |
| 497 | for _, listener := range p.listeners { |
| 498 | // need to loop through all the listeners to see if they need to resync so we can prepare any |
| 499 | // listeners that are going to be resyncing. |
| 500 | if listener.shouldResync(now) { |
| 501 | resyncNeeded = true |
| 502 | p.syncingListeners = append(p.syncingListeners, listener) |
| 503 | listener.determineNextResync(now) |
| 504 | } |
| 505 | } |
| 506 | return resyncNeeded |
| 507 | } |
| 508 | |
| 509 | func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Duration) { |
| 510 | p.listenersLock.RLock() |
nothing calls this directly
no test coverage detected