mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 13:55:55 +00:00
agent: Prevent hot spin on event list
This commit is contained in:
parent
144b9c529d
commit
6c30ccd3f7
@ -133,7 +133,10 @@ RUN_QUERY:
|
||||
// Determine the index
|
||||
var index uint64
|
||||
if len(events) == 0 {
|
||||
index = 0
|
||||
// Return a non-zero index to prevent a hot query loop. This
|
||||
// can be caused by a watch for example when there is no matching
|
||||
// events.
|
||||
index = 1
|
||||
} else {
|
||||
last := events[len(events)-1]
|
||||
index = uuidToUint64(last.ID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user