mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
cmd/vnet: omit log spam when backend status hasn't changed
Updates #13038 Change-Id: I9cc67cf18ba44ff66ba03cda486d5e111e395ce7
This commit is contained in:
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…
x
Reference in New Issue
Block a user