lib/watchaggregator: Don't delay mixed events only (#5094)

Also fix a minor bug in testing failure output.
This commit is contained in:
Simon Frei
2018-08-13 09:14:03 +02:00
committed by GitHub
parent 2c9d96375b
commit c55c0c8c28
2 changed files with 21 additions and 4 deletions

View File

@@ -308,8 +308,8 @@ func (a *aggregator) actOnTimer(out chan<- []string) {
}
oldEvents := make(map[string]*aggregatedEvent, c)
a.popOldEventsTo(oldEvents, a.root, ".", time.Now(), true)
if a.notifyDelay != a.notifyTimeout && a.counts[fs.NonRemove]+a.counts[fs.Mixed] == 0 && a.counts[fs.Remove] != 0 {
// Only deletion events remaining, no need to delay them additionally
if a.notifyDelay != a.notifyTimeout && a.counts[fs.NonRemove] == 0 && a.counts[fs.Remove]+a.counts[fs.Mixed] != 0 {
// Only delayed events remaining, no need to delay them additionally
a.popOldEventsTo(oldEvents, a.root, ".", time.Now(), false)
}
if len(oldEvents) == 0 {