mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 19:51:41 +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)
|
http.ListenAndServe(":8080", rp)
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
|
var last string
|
||||||
getStatus := func() {
|
getStatus := func() {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@ -97,7 +98,10 @@ func main() {
|
|||||||
log.Printf("NodeStatus: %v", err)
|
log.Printf("NodeStatus: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("NodeStatus: %v", logger.AsJSON(st))
|
if st.BackendState != last {
|
||||||
|
last = st.BackendState
|
||||||
|
log.Printf("NodeStatus: %v", logger.AsJSON(st))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user