agent: fix watch event behavior (#5265)

Use an equality match on the last event id, not a small value, to correct the random nature of the trigger
This commit is contained in:
ogidow 2019-12-10 20:02:21 +09:00 committed by Hans Hasselberg
parent 442924c35a
commit c7db07fc2a
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,8 @@ func (idx WaitIndexVal) Next(previous BlockingParamVal) BlockingParamVal {
return idx return idx
} }
prevIdx, ok := previous.(WaitIndexVal) prevIdx, ok := previous.(WaitIndexVal)
if ok && prevIdx > idx { if ok && prevIdx == idx {
// This value is smaller than the previous index, reset. // This value is the same as the previous index, reset
return WaitIndexVal(0) return WaitIndexVal(0)
} }
return idx return idx