Finish kubernetes throttling refactoring

This commit is contained in:
mpl
2019-08-31 14:10:04 +02:00
committed by Traefiker Bot
parent bee370ec6b
commit 4cae8bcb10

View File

@@ -141,13 +141,16 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
}
throttleDuration := time.Duration(p.ThrottleDuration)
eventsChanToRead := throttleEvents(throttleDuration, stop, eventsChan)
throttledChan := throttleEvents(throttleDuration, stop, eventsChan)
if throttledChan != nil {
eventsChan = throttledChan
}
for {
select {
case <-stop:
return nil
case event := <-eventsChanToRead:
case event := <-eventsChan:
// Note that event is the *first* event that came in during this
// throttling interval -- if we're hitting our throttle, we may have
// dropped events. This is fine, because we don't treat different