From dfa8d919f76c2ed9839973ea62e991fb2ab1abba Mon Sep 17 00:00:00 2001 From: ogidow Date: Tue, 10 Dec 2019 20:02:21 +0900 Subject: [PATCH] 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 --- api/watch/watch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/watch/watch.go b/api/watch/watch.go index 3690a20c97..09ee15edd2 100644 --- a/api/watch/watch.go +++ b/api/watch/watch.go @@ -88,8 +88,8 @@ func (idx WaitIndexVal) Next(previous BlockingParamVal) BlockingParamVal { return idx } prevIdx, ok := previous.(WaitIndexVal) - if ok && prevIdx > idx { - // This value is smaller than the previous index, reset. + if ok && prevIdx == idx { + // This value is the same as the previous index, reset return WaitIndexVal(0) } return idx