ipn: don't log redundant peer stats so often

It was especially bad on our GUI platforms with a frontend that polls it.

No need to log it every few seconds if it's unchanged. Make it slightly
less allocate-y while I'm here.
This commit is contained in:
Brad Fitzpatrick
2020-10-29 15:26:10 -07:00
parent 8b904b1493
commit 2b819ab38c
2 changed files with 21 additions and 15 deletions

View File

@@ -83,7 +83,9 @@ func TestLocalLogLines(t *testing.T) {
}},
LocalAddrs: []string{"idk an address"},
}
lb.parseWgStatus(status)
lb.mu.Lock()
lb.parseWgStatusLocked(status)
lb.mu.Unlock()
t.Run("after_peers", testWantRemain())
}