cmd/vnet: omit log spam when backend status hasn't changed

Updates #13038

Change-Id: I9cc67cf18ba44ff66ba03cda486d5e111e395ce7
pull/13252/head
Brad Fitzpatrick 3 months ago committed by Brad Fitzpatrick
parent e5fd36ad78
commit 475ab1fb67

@ -89,6 +89,7 @@ func main() {
http.ListenAndServe(":8080", rp)
}()
go func() {
var last string
getStatus := func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
@ -97,7 +98,10 @@ func main() {
log.Printf("NodeStatus: %v", err)
return
}
log.Printf("NodeStatus: %v", logger.AsJSON(st))
if st.BackendState != last {
last = st.BackendState
log.Printf("NodeStatus: %v", logger.AsJSON(st))
}
}
for {
time.Sleep(5 * time.Second)

Loading…
Cancel
Save